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

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

  @Override
  public AccelerationUnit<D> baseUnit() { return (AccelerationUnit<D>) unit().getBaseUnit(); }

  @Override
  public double in(AccelerationUnit<D> unit) {
    return unit.fromBaseUnits(baseUnitMagnitude());
  }

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

  @Override
  public Acceleration<D> unaryMinus() {
    return (Acceleration<D>) unit().ofBaseUnits(0 - baseUnitMagnitude());
  }

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

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

  @Override
  public Acceleration<D> times(double multiplier) {
    return (Acceleration<D>) unit().ofBaseUnits(baseUnitMagnitude() * multiplier);
  }

  @Override
  public Acceleration<D> div(double divisor) {
    return (Acceleration<D>) unit().ofBaseUnits(baseUnitMagnitude() / divisor);
  }


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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

  @Override
  public Acceleration<D> div(Dimensionless divisor) {
    return (Acceleration<D>) unit().of(baseUnitMagnitude() / divisor.baseUnitMagnitude());
  }

  @Override
  public Acceleration<D> times(Dimensionless multiplier) {
    return (Acceleration<D>) unit().of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
  }


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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

}
