Record Class CanandcolorStatus
java.lang.Object
java.lang.Record
com.reduxrobotics.sensors.canandcolor.CanandcolorStatus
- Record Components:
activeFaults- the active faults of the device.stickyFaults- the sticky faults of the device.temperature- the onboard temperature of the device.
- All Implemented Interfaces:
StructSerializable,WPISerializable
public record CanandcolorStatus(CanandcolorFaults activeFaults, CanandcolorFaults stickyFaults, double temperature)
extends Record
implements StructSerializable
Container record class representing a
Canandcolor's status.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CanandcolorStatusStructThis field is necessary for WPILib structs to work around Java type erasure. -
Constructor Summary
ConstructorsConstructorDescriptionCanandcolorStatus(CanandcolorFaults activeFaults, CanandcolorFaults stickyFaults, double temperature) Creates an instance of aCanandcolorStatusrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theactiveFaultsrecord component.final booleanIndicates whether some other object is "equal to" this one.static CanandcolorStatusfromByteArray(byte[] v) Deserializes a Status object from a byte array.static CanandcolorStatusfromLong(long data) Deserializes a Status object from a long.final inthashCode()Returns a hash code value for this object.static CanandcolorStatusinvalid()Returns a default Status record for frame initializionReturns the value of thestickyFaultsrecord component.doubleReturns the value of thetemperaturerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
struct
This field is necessary for WPILib structs to work around Java type erasure.
-
-
Constructor Details
-
CanandcolorStatus
public CanandcolorStatus(CanandcolorFaults activeFaults, CanandcolorFaults stickyFaults, double temperature) Creates an instance of aCanandcolorStatusrecord class.- Parameters:
activeFaults- the value for theactiveFaultsrecord componentstickyFaults- the value for thestickyFaultsrecord componenttemperature- the value for thetemperaturerecord component
-
-
Method Details
-
invalid
Returns a default Status record for frame initializion- Returns:
- invalid Status record
-
fromByteArray
Deserializes a Status object from a byte array.- Parameters:
v- array to deserialize from- Returns:
- new Status
-
fromLong
Deserializes a Status object from a long.- Parameters:
data- 64-bit long data- Returns:
- new Status
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
activeFaults
Returns the value of theactiveFaultsrecord component.- Returns:
- the value of the
activeFaultsrecord component
-
stickyFaults
Returns the value of thestickyFaultsrecord component.- Returns:
- the value of the
stickyFaultsrecord component
-
temperature
public double temperature()Returns the value of thetemperaturerecord component.- Returns:
- the value of the
temperaturerecord component
-