Record Class CanandgyroStatus
java.lang.Object
java.lang.Record
com.reduxrobotics.sensors.canandgyro.CanandgyroStatus
- Record Components:
activeFaults- the active faults of the device.stickyFaults- the sticky faults of the device.temperature- the temperature of the device's processor, in deg Celsius.
- All Implemented Interfaces:
StructSerializable,WPISerializable
public record CanandgyroStatus(boolean valid, CanandgyroFaults activeFaults, CanandgyroFaults stickyFaults, double temperature)
extends Record
implements StructSerializable
Container record class representing a
Canandgyro's status.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CanandgyroStatusStructThis field is necessary for WPILib structs to work around Java type erasure. -
Constructor Summary
ConstructorsConstructorDescriptionCanandgyroStatus(boolean valid, CanandgyroFaults activeFaults, CanandgyroFaults stickyFaults, double temperature) Creates an instance of aCanandgyroStatusrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theactiveFaultsrecord component.final booleanIndicates whether some other object is "equal to" this one.static CanandgyroStatusfromByteArray(byte[] v) Deserializes a Status object from a byte array.static CanandgyroStatusfromLong(long v) Deserializes a Status object from a long.final inthashCode()Returns a hash code value for this object.static CanandgyroStatusinvalid()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.booleanvalid()Returns the value of thevalidrecord component.
-
Field Details
-
struct
This field is necessary for WPILib structs to work around Java type erasure.
-
-
Constructor Details
-
CanandgyroStatus
public CanandgyroStatus(boolean valid, CanandgyroFaults activeFaults, CanandgyroFaults stickyFaults, double temperature) Creates an instance of aCanandgyroStatusrecord class.- Parameters:
valid- the value for thevalidrecord componentactiveFaults- 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- byte array to deserialize from- Returns:
- new Status
-
fromLong
Deserializes a Status object from a long.- Parameters:
v- 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 '=='. -
valid
public boolean valid()Returns the value of thevalidrecord component.- Returns:
- the value of the
validrecord component
-
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
-