Record Class Parsec.Config

java.lang.Object
java.lang.Record
com.studica.frc.Parsec.Config
Record Components:
version - configuration version (CAN)
distanceEnabled - true if distance output is on
canFd - true if the device talks CAN FD (CAN)
canBitRateSwitch - true if CAN FD bit-rate switching is on (CAN)
canId - the configured CAN ID
zoneMask - enabled zones, one bit each (CAN FD and USB)
firmware - firmware version
outputRateHz - frames per second (USB)
zones - 16 or 64 (USB)
Enclosing class:
Parsec

public static record Parsec.Config(int version, boolean distanceEnabled, boolean canFd, boolean canBitRateSwitch, int canId, OptionalLong zoneMask, Optional<FirmwareVersion> firmware, OptionalInt outputRateHz, OptionalInt zones) extends Record
Parsec configuration, as reported by the device. version, canFd and canBitRateSwitch are only reported over CAN; the optional fields are empty when the connection doesn't report them.
  • Constructor Details

    • Config

      public Config(int version, boolean distanceEnabled, boolean canFd, boolean canBitRateSwitch, int canId, OptionalLong zoneMask, Optional<FirmwareVersion> firmware, OptionalInt outputRateHz, OptionalInt zones)
      Creates an instance of a Config record class.
      Parameters:
      version - the value for the version record component
      distanceEnabled - the value for the distanceEnabled record component
      canFd - the value for the canFd record component
      canBitRateSwitch - the value for the canBitRateSwitch record component
      canId - the value for the canId record component
      zoneMask - the value for the zoneMask record component
      firmware - the value for the firmware record component
      outputRateHz - the value for the outputRateHz record component
      zones - the value for the zones record component
  • Method Details

    • toString

      public final 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • version

      public int version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • distanceEnabled

      public boolean distanceEnabled()
      Returns the value of the distanceEnabled record component.
      Returns:
      the value of the distanceEnabled record component
    • canFd

      public boolean canFd()
      Returns the value of the canFd record component.
      Returns:
      the value of the canFd record component
    • canBitRateSwitch

      public boolean canBitRateSwitch()
      Returns the value of the canBitRateSwitch record component.
      Returns:
      the value of the canBitRateSwitch record component
    • canId

      public int canId()
      Returns the value of the canId record component.
      Returns:
      the value of the canId record component
    • zoneMask

      public OptionalLong zoneMask()
      Returns the value of the zoneMask record component.
      Returns:
      the value of the zoneMask record component
    • firmware

      public Optional<FirmwareVersion> firmware()
      Returns the value of the firmware record component.
      Returns:
      the value of the firmware record component
    • outputRateHz

      public OptionalInt outputRateHz()
      Returns the value of the outputRateHz record component.
      Returns:
      the value of the outputRateHz record component
    • zones

      public OptionalInt zones()
      Returns the value of the zones record component.
      Returns:
      the value of the zones record component