Record Class SwerveModuleStates
java.lang.Object
java.lang.Record
xbot.common.subsystems.drive.swerve.SwerveModuleStates
public record SwerveModuleStates(SwerveModuleState frontLeft, SwerveModuleState frontRight, SwerveModuleState rearLeft, SwerveModuleState rearRight)
extends Record
A simple record to hold the states of all four swerve modules.
-
Constructor Summary
ConstructorsConstructorDescriptionSwerveModuleStates(SwerveModuleState frontLeft, SwerveModuleState frontRight, SwerveModuleState rearLeft, SwerveModuleState rearRight) Creates an instance of aSwerveModuleStatesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thefrontLeftrecord component.Returns the value of thefrontRightrecord component.final inthashCode()Returns a hash code value for this object.rearLeft()Returns the value of therearLeftrecord component.Returns the value of therearRightrecord component.toArray()final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SwerveModuleStates
public SwerveModuleStates(SwerveModuleState frontLeft, SwerveModuleState frontRight, SwerveModuleState rearLeft, SwerveModuleState rearRight) Creates an instance of aSwerveModuleStatesrecord class.- Parameters:
frontLeft- the value for thefrontLeftrecord componentfrontRight- the value for thefrontRightrecord componentrearLeft- the value for therearLeftrecord componentrearRight- the value for therearRightrecord component
-
-
Method Details
-
toArray
-
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. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code 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. All components in this record class are compared withObjects::equals(Object,Object). -
frontLeft
Returns the value of thefrontLeftrecord component.- Returns:
- the value of the
frontLeftrecord component
-
frontRight
Returns the value of thefrontRightrecord component.- Returns:
- the value of the
frontRightrecord component
-
rearLeft
Returns the value of therearLeftrecord component.- Returns:
- the value of the
rearLeftrecord component
-
rearRight
Returns the value of therearRightrecord component.- Returns:
- the value of the
rearRightrecord component
-