Package com.reduxrobotics.canand
Record Class CanandFirmwareVersion
java.lang.Object
java.lang.Record
com.reduxrobotics.canand.CanandFirmwareVersion
- Record Components:
year
- the year associated with the firmware version. Within a year/season, the message API is expected to remain the same until the postseason.minor
- the minor number associated with the firmware versionpatch
- the patch number associated with the firmware version
- All Implemented Interfaces:
Comparable<CanandFirmwareVersion>
public record CanandFirmwareVersion(int year, int minor, int patch)
extends Record
implements Comparable<CanandFirmwareVersion>
Represents a firmware version associated with a Redux product.
-
Constructor Summary
ConstructorDescriptionCanandFirmwareVersion
(int year, int minor, int patch) Creates an instance of aCanandFirmwareVersion
record class.CanandFirmwareVersion
(long data) Returns a new CanandFirmwareVersion generated from setting data. -
Method Summary
Modifier and TypeMethodDescriptionint
final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
minor()
Returns the value of theminor
record component.int
patch()
Returns the value of thepatch
record component.long
Serializes the firmware version record into a wire-formattable Long.toString()
Returns a string representation of this record class.int
year()
Returns the value of theyear
record component.
-
Constructor Details
-
CanandFirmwareVersion
public CanandFirmwareVersion(long data) Returns a new CanandFirmwareVersion generated from setting data.- Parameters:
data
- setting data, as a long
-
CanandFirmwareVersion
public CanandFirmwareVersion(int year, int minor, int patch) Creates an instance of aCanandFirmwareVersion
record class.
-
-
Method Details
-
toSettingData
public long toSettingData()Serializes the firmware version record into a wire-formattable Long.- Returns:
- long representing the setting data.
-
compareTo
- Specified by:
compareTo
in interfaceComparable<CanandFirmwareVersion>
-
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 with '=='. -
year
public int year()Returns the value of theyear
record component.- Returns:
- the value of the
year
record component
-
minor
public int minor()Returns the value of theminor
record component.- Returns:
- the value of the
minor
record component
-
patch
public int patch()Returns the value of thepatch
record component.- Returns:
- the value of the
patch
record component
-