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

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

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

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

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

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

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

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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

  @Override
  public Mass per(LinearAccelerationUnit divisorUnit) {
    return div(divisorUnit.one());
  }


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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

}
