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 oncanFd- true if the device talks CAN FD (CAN)canBitRateSwitch- true if CAN FD bit-rate switching is on (CAN)canId- the configured CAN IDzoneMask- enabled zones, one bit each (CAN FD and USB)firmware- firmware versionoutputRateHz- 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 Summary
ConstructorsConstructorDescriptionConfig(int version, boolean distanceEnabled, boolean canFd, boolean canBitRateSwitch, int canId, OptionalLong zoneMask, Optional<FirmwareVersion> firmware, OptionalInt outputRateHz, OptionalInt zones) Creates an instance of aConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecanBitRateSwitchrecord component.booleancanFd()Returns the value of thecanFdrecord component.intcanId()Returns the value of thecanIdrecord component.booleanReturns the value of thedistanceEnabledrecord component.final booleanIndicates whether some other object is "equal to" this one.firmware()Returns the value of thefirmwarerecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theoutputRateHzrecord component.final StringtoString()Returns a string representation of this record class.intversion()Returns the value of theversionrecord component.zoneMask()Returns the value of thezoneMaskrecord component.zones()Returns the value of thezonesrecord component.
-
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 aConfigrecord class.- Parameters:
version- the value for theversionrecord componentdistanceEnabled- the value for thedistanceEnabledrecord componentcanFd- the value for thecanFdrecord componentcanBitRateSwitch- the value for thecanBitRateSwitchrecord componentcanId- the value for thecanIdrecord componentzoneMask- the value for thezoneMaskrecord componentfirmware- the value for thefirmwarerecord componentoutputRateHz- the value for theoutputRateHzrecord componentzones- the value for thezonesrecord component
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
version
-
distanceEnabled
public boolean distanceEnabled()Returns the value of thedistanceEnabledrecord component.- Returns:
- the value of the
distanceEnabledrecord component
-
canFd
-
canBitRateSwitch
public boolean canBitRateSwitch()Returns the value of thecanBitRateSwitchrecord component.- Returns:
- the value of the
canBitRateSwitchrecord component
-
canId
-
zoneMask
-
firmware
-
outputRateHz
Returns the value of theoutputRateHzrecord component.- Returns:
- the value of the
outputRateHzrecord component
-
zones
-