Package edu.wpi.first.units.measure
Record Class ImmutableTorque
java.lang.Object
java.lang.Record
edu.wpi.first.units.measure.ImmutableTorque
- All Implemented Interfaces:
Measure<TorqueUnit>,Torque,Comparable<Measure<TorqueUnit>>
public record ImmutableTorque(double magnitude, double baseUnitMagnitude, TorqueUnit unit)
extends Record
implements Torque
-
Field Summary
Fields inherited from interface edu.wpi.first.units.Measure
EQUIVALENCE_THRESHOLD -
Constructor Summary
ConstructorsConstructorDescriptionImmutableTorque(double magnitude, double baseUnitMagnitude, TorqueUnit unit) Creates an instance of aImmutableTorquerecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of thebaseUnitMagnituderecord component.copy()Returns an immutable copy of this measure.booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doubleReturns the value of themagnituderecord component.toString()Returns a string representation of this record class.unit()Returns the value of theunitrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface edu.wpi.first.units.Measure
abs, compareTo, copySign, div, divide, divideRatio, gt, gte, isEquivalent, isNear, isNear, lt, lte, times, timesConversionFactor, timesInverse, timesRatio, toLongString, toShortStringMethods inherited from interface edu.wpi.first.units.measure.Torque
baseUnit, div, div, div, div, div, div, div, div, div, div, div, div, div, div, div, div, div, div, div, div, div, div, div, div, div, div, divide, divide, divide, divide, divide, divide, divide, divide, divide, divide, divide, divide, divide, divide, divide, divide, divide, divide, divide, divide, divide, divide, divide, divide, divide, divide, in, minus, mutableCopy, negate, per, per, per, per, per, per, per, per, per, per, per, per, per, per, per, per, per, per, per, per, per, per, per, per, plus, times, times, times, times, times, times, times, times, times, times, times, times, times, times, times, times, times, times, times, times, times, times, times, times, times, times, unaryMinus
-
Constructor Details
-
ImmutableTorque
Creates an instance of aImmutableTorquerecord class.- Parameters:
magnitude- the value for themagnituderecord componentbaseUnitMagnitude- the value for thebaseUnitMagnituderecord componentunit- the value for theunitrecord component
-
-
Method Details
-
copy
Description copied from interface:MeasureReturns an immutable copy of this measure. The copy can be used freely and is guaranteed never to change.- Specified by:
copyin interfaceMeasure<TorqueUnit>- Specified by:
copyin interfaceTorque- Returns:
- the copied measure
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
hashCode
Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
magnitude
Returns the value of themagnituderecord component.- Specified by:
magnitudein interfaceMeasure<TorqueUnit>- Returns:
- the value of the
magnituderecord component
-
baseUnitMagnitude
Returns the value of thebaseUnitMagnituderecord component.- Specified by:
baseUnitMagnitudein interfaceMeasure<TorqueUnit>- Returns:
- the value of the
baseUnitMagnituderecord component
-
unit
Returns the value of theunitrecord component.- Specified by:
unitin interfaceMeasure<TorqueUnit>- Specified by:
unitin interfaceTorque- Returns:
- the value of the
unitrecord component
-