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

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

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

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

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

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

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

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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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

}
