// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

// THIS FILE WAS AUTO-GENERATED BY ./wpiunits/generate_units.py. DO NOT MODIFY

package org.wpilib.units.measure;

import static org.wpilib.units.Units.*;
import org.wpilib.units.*;

@SuppressWarnings({"unchecked", "cast", "checkstyle"})
public record MomentOfInertia(double magnitude, double baseUnitMagnitude, MomentOfInertiaUnit unit) implements Measure<MomentOfInertiaUnit> {
  /**
   * For doing math with measures of a known dimension but an unknown unit. Most users should use
   * {@link MomentOfInertiaUnit#of(double)} on a known unit from {@link Units} instead of calling this method.
   * @param magnitude the magnitude of the measurement in terms of the given unit
   * @param unit the unit of the measurement
   * @return a measurement object
   */
  public static  MomentOfInertia ofRelativeUnits(double magnitude, MomentOfInertiaUnit unit) {
    return new MomentOfInertia(magnitude, unit.toBaseUnits(magnitude), unit);
  }

  /**
   * For doing math with measures of a known dimension but an unknown unit. Most users should use
   * {@link MomentOfInertiaUnit#of(double)} on a known unit from {@link Units} instead of calling this method.
   * @param baseUnitMagnitude the magnitude of the measurement in terms of the given unit's base unit
   * @param unit the unit of the measurement
   * @return a measurement object
   */
  public static  MomentOfInertia ofBaseUnits(double baseUnitMagnitude, MomentOfInertiaUnit unit) {
    return new MomentOfInertia(unit.fromBaseUnits(baseUnitMagnitude), baseUnitMagnitude, unit);
  }

  @Override
  public MomentOfInertiaUnit baseUnit() { return (MomentOfInertiaUnit) unit().getBaseUnit(); }

  @Override
  public double in(MomentOfInertiaUnit unit) {
    return unit.fromBaseUnits(baseUnitMagnitude());
  }

  @Override
  @SuppressWarnings("rawtypes")
  public boolean equals(Object object) {
    return object instanceof MomentOfInertia m && isEquivalent(m);
  }

  @Override
  public MomentOfInertia unaryMinus() {
    return (MomentOfInertia) unit().ofBaseUnits(0 - baseUnitMagnitude());
  }

  @Override
  public MomentOfInertia plus(Measure<? extends MomentOfInertiaUnit> other) {
    return (MomentOfInertia) unit().ofBaseUnits(baseUnitMagnitude() + other.baseUnitMagnitude());
  }

  @Override
  public MomentOfInertia minus(Measure<? extends MomentOfInertiaUnit> other) {
    return (MomentOfInertia) unit().ofBaseUnits(baseUnitMagnitude() - other.baseUnitMagnitude());
  }

  @Override
  public MomentOfInertia times(double multiplier) {
    return (MomentOfInertia) unit().ofBaseUnits(baseUnitMagnitude() * multiplier);
  }

  @Override
  public MomentOfInertia div(double divisor) {
    return (MomentOfInertia) unit().ofBaseUnits(baseUnitMagnitude() / divisor);
  }


  @Override
  public Mult<MomentOfInertiaUnit, AccelerationUnit<?>> times(Acceleration<?> multiplier) {
    return (Mult<MomentOfInertiaUnit, AccelerationUnit<?>>) Measure.super.times(multiplier);
  }

  @Override
  public Per<MomentOfInertiaUnit, AccelerationUnit<?>> div(Acceleration<?> divisor) {
    return (Per<MomentOfInertiaUnit, AccelerationUnit<?>>) Measure.super.div(divisor);
  }

  @Override
  public Per<MomentOfInertiaUnit, AccelerationUnit<?>> per(AccelerationUnit<?> divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<MomentOfInertiaUnit, AngleUnit> times(Angle multiplier) {
    return (Mult<MomentOfInertiaUnit, AngleUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<MomentOfInertiaUnit, AngleUnit> div(Angle divisor) {
    return (Per<MomentOfInertiaUnit, AngleUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<MomentOfInertiaUnit, AngleUnit> per(AngleUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<MomentOfInertiaUnit, AngularAccelerationUnit> times(AngularAcceleration multiplier) {
    return (Mult<MomentOfInertiaUnit, AngularAccelerationUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<MomentOfInertiaUnit, AngularAccelerationUnit> div(AngularAcceleration divisor) {
    return (Per<MomentOfInertiaUnit, AngularAccelerationUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<MomentOfInertiaUnit, AngularAccelerationUnit> per(AngularAccelerationUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<MomentOfInertiaUnit, AngularMomentumUnit> times(AngularMomentum multiplier) {
    return (Mult<MomentOfInertiaUnit, AngularMomentumUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<MomentOfInertiaUnit, AngularMomentumUnit> div(AngularMomentum divisor) {
    return (Per<MomentOfInertiaUnit, AngularMomentumUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<MomentOfInertiaUnit, AngularMomentumUnit> per(AngularMomentumUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public AngularMomentum times(AngularVelocity multiplier) {
    return KilogramMetersSquaredPerSecond.of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
  }

  @Override
  public Per<MomentOfInertiaUnit, AngularVelocityUnit> div(AngularVelocity divisor) {
    return (Per<MomentOfInertiaUnit, AngularVelocityUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<MomentOfInertiaUnit, AngularVelocityUnit> per(AngularVelocityUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<MomentOfInertiaUnit, CurrentUnit> times(Current multiplier) {
    return (Mult<MomentOfInertiaUnit, CurrentUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<MomentOfInertiaUnit, CurrentUnit> div(Current divisor) {
    return (Per<MomentOfInertiaUnit, CurrentUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<MomentOfInertiaUnit, CurrentUnit> per(CurrentUnit divisorUnit) {
    return div(divisorUnit.one());
  }

  @Override
  public MomentOfInertia div(Dimensionless divisor) {
    return (MomentOfInertia) KilogramSquareMeters.of(baseUnitMagnitude() / divisor.baseUnitMagnitude());
  }

  @Override
  public MomentOfInertia times(Dimensionless multiplier) {
    return (MomentOfInertia) KilogramSquareMeters.of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
  }


  @Override
  public Mult<MomentOfInertiaUnit, DistanceUnit> times(Distance multiplier) {
    return (Mult<MomentOfInertiaUnit, DistanceUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<MomentOfInertiaUnit, DistanceUnit> div(Distance divisor) {
    return (Per<MomentOfInertiaUnit, DistanceUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<MomentOfInertiaUnit, DistanceUnit> per(DistanceUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<MomentOfInertiaUnit, EnergyUnit> times(Energy multiplier) {
    return (Mult<MomentOfInertiaUnit, EnergyUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<MomentOfInertiaUnit, EnergyUnit> div(Energy divisor) {
    return (Per<MomentOfInertiaUnit, EnergyUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<MomentOfInertiaUnit, EnergyUnit> per(EnergyUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<MomentOfInertiaUnit, ForceUnit> times(Force multiplier) {
    return (Mult<MomentOfInertiaUnit, ForceUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<MomentOfInertiaUnit, ForceUnit> div(Force divisor) {
    return (Per<MomentOfInertiaUnit, ForceUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<MomentOfInertiaUnit, ForceUnit> per(ForceUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<MomentOfInertiaUnit, FrequencyUnit> times(Frequency multiplier) {
    return (Mult<MomentOfInertiaUnit, FrequencyUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<MomentOfInertiaUnit, FrequencyUnit> div(Frequency divisor) {
    return (Per<MomentOfInertiaUnit, FrequencyUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<MomentOfInertiaUnit, FrequencyUnit> per(FrequencyUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<MomentOfInertiaUnit, LinearAccelerationUnit> times(LinearAcceleration multiplier) {
    return (Mult<MomentOfInertiaUnit, LinearAccelerationUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<MomentOfInertiaUnit, LinearAccelerationUnit> div(LinearAcceleration divisor) {
    return (Per<MomentOfInertiaUnit, LinearAccelerationUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<MomentOfInertiaUnit, LinearAccelerationUnit> per(LinearAccelerationUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<MomentOfInertiaUnit, LinearMomentumUnit> times(LinearMomentum multiplier) {
    return (Mult<MomentOfInertiaUnit, LinearMomentumUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<MomentOfInertiaUnit, LinearMomentumUnit> div(LinearMomentum divisor) {
    return (Per<MomentOfInertiaUnit, LinearMomentumUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<MomentOfInertiaUnit, LinearMomentumUnit> per(LinearMomentumUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<MomentOfInertiaUnit, LinearVelocityUnit> times(LinearVelocity multiplier) {
    return (Mult<MomentOfInertiaUnit, LinearVelocityUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<MomentOfInertiaUnit, LinearVelocityUnit> div(LinearVelocity divisor) {
    return (Per<MomentOfInertiaUnit, LinearVelocityUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<MomentOfInertiaUnit, LinearVelocityUnit> per(LinearVelocityUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<MomentOfInertiaUnit, MassUnit> times(Mass multiplier) {
    return (Mult<MomentOfInertiaUnit, MassUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<MomentOfInertiaUnit, MassUnit> div(Mass divisor) {
    return (Per<MomentOfInertiaUnit, MassUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<MomentOfInertiaUnit, MassUnit> per(MassUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<MomentOfInertiaUnit, MomentOfInertiaUnit> times(MomentOfInertia multiplier) {
    return (Mult<MomentOfInertiaUnit, MomentOfInertiaUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Dimensionless div(MomentOfInertia divisor) {
    return Value.of(baseUnitMagnitude() / divisor.baseUnitMagnitude());
  }

  @Override
  public Dimensionless per(MomentOfInertiaUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<MomentOfInertiaUnit, MultUnit<?, ?>> times(Mult<?, ?> multiplier) {
    return (Mult<MomentOfInertiaUnit, MultUnit<?, ?>>) Measure.super.times(multiplier);
  }

  @Override
  public Per<MomentOfInertiaUnit, MultUnit<?, ?>> div(Mult<?, ?> divisor) {
    return (Per<MomentOfInertiaUnit, MultUnit<?, ?>>) Measure.super.div(divisor);
  }

  @Override
  public Per<MomentOfInertiaUnit, MultUnit<?, ?>> per(MultUnit<?, ?> divisorUnit) {
    return div(divisorUnit.ofNative(1));
  }


  @Override
  public Mult<MomentOfInertiaUnit, PerUnit<?, ?>> times(Per<?, ?> multiplier) {
    return (Mult<MomentOfInertiaUnit, PerUnit<?, ?>>) Measure.super.times(multiplier);
  }

  @Override
  public Per<MomentOfInertiaUnit, PerUnit<?, ?>> div(Per<?, ?> divisor) {
    return (Per<MomentOfInertiaUnit, PerUnit<?, ?>>) Measure.super.div(divisor);
  }

  @Override
  public Per<MomentOfInertiaUnit, PerUnit<?, ?>> per(PerUnit<?, ?> divisorUnit) {
    return div(divisorUnit.ofNative(1));
  }


  @Override
  public Mult<MomentOfInertiaUnit, PowerUnit> times(Power multiplier) {
    return (Mult<MomentOfInertiaUnit, PowerUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<MomentOfInertiaUnit, PowerUnit> div(Power divisor) {
    return (Per<MomentOfInertiaUnit, PowerUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<MomentOfInertiaUnit, PowerUnit> per(PowerUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<MomentOfInertiaUnit, ResistanceUnit> times(Resistance multiplier) {
    return (Mult<MomentOfInertiaUnit, ResistanceUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<MomentOfInertiaUnit, ResistanceUnit> div(Resistance divisor) {
    return (Per<MomentOfInertiaUnit, ResistanceUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<MomentOfInertiaUnit, ResistanceUnit> per(ResistanceUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<MomentOfInertiaUnit, TemperatureUnit> times(Temperature multiplier) {
    return (Mult<MomentOfInertiaUnit, TemperatureUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<MomentOfInertiaUnit, TemperatureUnit> div(Temperature divisor) {
    return (Per<MomentOfInertiaUnit, TemperatureUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<MomentOfInertiaUnit, TemperatureUnit> per(TemperatureUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<MomentOfInertiaUnit, TimeUnit> times(Time multiplier) {
    return (Mult<MomentOfInertiaUnit, TimeUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Velocity<MomentOfInertiaUnit> div(Time divisor) {
    return VelocityUnit.combine(unit(), divisor.unit()).ofBaseUnits(baseUnitMagnitude() / divisor.baseUnitMagnitude());
  }

  @Override
  public Velocity<MomentOfInertiaUnit> per(TimeUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<MomentOfInertiaUnit, TorqueUnit> times(Torque multiplier) {
    return (Mult<MomentOfInertiaUnit, TorqueUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<MomentOfInertiaUnit, TorqueUnit> div(Torque divisor) {
    return (Per<MomentOfInertiaUnit, TorqueUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<MomentOfInertiaUnit, TorqueUnit> per(TorqueUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<MomentOfInertiaUnit, VelocityUnit<?>> times(Velocity<?> multiplier) {
    return (Mult<MomentOfInertiaUnit, VelocityUnit<?>>) Measure.super.times(multiplier);
  }

  @Override
  public Per<MomentOfInertiaUnit, VelocityUnit<?>> div(Velocity<?> divisor) {
    return (Per<MomentOfInertiaUnit, VelocityUnit<?>>) Measure.super.div(divisor);
  }

  @Override
  public Per<MomentOfInertiaUnit, VelocityUnit<?>> per(VelocityUnit<?> divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<MomentOfInertiaUnit, VoltageUnit> times(Voltage multiplier) {
    return (Mult<MomentOfInertiaUnit, VoltageUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<MomentOfInertiaUnit, VoltageUnit> div(Voltage divisor) {
    return (Per<MomentOfInertiaUnit, VoltageUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<MomentOfInertiaUnit, VoltageUnit> per(VoltageUnit divisorUnit) {
    return div(divisorUnit.one());
  }

}
