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

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

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

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

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

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

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

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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


  @Override
  public Voltage times(Current multiplier) {
    return Volts.of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
  }

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

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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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

}
