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

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

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

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

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

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

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

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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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

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

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


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

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

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


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

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

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


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

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

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


  @Override
  public LinearAcceleration times(Frequency multiplier) {
    return MetersPerSecondPerSecond.of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
  }

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


  @Override
  public Distance times(Time multiplier) {
    return Meters.of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
  }

  @Override
  public LinearAcceleration div(Time divisor) {
    return MetersPerSecondPerSecond.of(baseUnitMagnitude() / divisor.baseUnitMagnitude());
  }

  @Override
  public LinearAcceleration per(TimeUnit divisorUnit) {
    return div(divisorUnit.one());
  }


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

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

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


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

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

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


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

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

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

}
