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 version
patch - 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

    Constructors
    Constructor
    Description
    CanandFirmwareVersion(int year, int minor, int patch)
    Creates an instance of a CanandFirmwareVersion record class.
    Returns a new CanandFirmwareVersion generated from setting data.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the minor record component.
    int
    Returns the value of the patch record component.
    long
    Serializes the firmware version record into a wire-formattable Long.
    Returns a string representation of this record class.
    int
    Returns the value of the year record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 a CanandFirmwareVersion record class.
      Parameters:
      year - the value for the year record component
      minor - the value for the minor record component
      patch - the value for the patch record component
  • Method Details

    • toSettingData

      public long toSettingData()
      Serializes the firmware version record into a wire-formattable Long.
      Returns:
      long representing the setting data.
    • compareTo

      public int compareTo(CanandFirmwareVersion arg0)
      Specified by:
      compareTo in interface Comparable<CanandFirmwareVersion>
    • toString

      public String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • year

      public int year()
      Returns the value of the year record component.
      Returns:
      the value of the year record component
    • minor

      public int minor()
      Returns the value of the minor record component.
      Returns:
      the value of the minor record component
    • patch

      public int patch()
      Returns the value of the patch record component.
      Returns:
      the value of the patch record component