// 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 AngularMomentum(double magnitude, double baseUnitMagnitude, AngularMomentumUnit unit) implements Measure<AngularMomentumUnit> {
  /**
   * For doing math with measures of a known dimension but an unknown unit. Most users should use
   * {@link AngularMomentumUnit#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  AngularMomentum ofRelativeUnits(double magnitude, AngularMomentumUnit unit) {
    return new AngularMomentum(magnitude, unit.toBaseUnits(magnitude), unit);
  }

  /**
   * For doing math with measures of a known dimension but an unknown unit. Most users should use
   * {@link AngularMomentumUnit#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  AngularMomentum ofBaseUnits(double baseUnitMagnitude, AngularMomentumUnit unit) {
    return new AngularMomentum(unit.fromBaseUnits(baseUnitMagnitude), baseUnitMagnitude, unit);
  }

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

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

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

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

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

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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

  @Override
  public MomentOfInertia per(AngularVelocityUnit divisorUnit) {
    return div(divisorUnit.one());
  }


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

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

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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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

}
