Record Class DeviceInfo
java.lang.Object
java.lang.Record
xbot.common.injection.electrical_contract.DeviceInfo
- Record Components:
name- device namechannel- channel or device numberinverted- whether the device's reading is invertedcanBusId- CAN bus identity, ignored by non-CAN devicespowerFrom- power-source metadata
public record DeviceInfo(String name, int channel, boolean inverted, CANBusId canBusId, PowerSource powerFrom)
extends Record
Immutable device configuration. Construction does not validate or reserve hardware.
DeviceInfo encoder = DeviceInfo.builder("SteeringEncoder").withCanBus(CANPort.CAN_S1, 11).withInverted(true).build();
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionDeviceInfo(String name, int channel, boolean inverted, CANBusId canBusId, PowerSource powerFrom) Creates an instance of aDeviceInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic DeviceInfo.BuilderStarts a builder with no inversion, CAN_S0, and no power-source metadata.canBusId()Returns the value of thecanBusIdrecord component.intchannel()Returns the value of thechannelrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleaninverted()Returns the value of theinvertedrecord component.name()Returns the value of thenamerecord component.Returns the value of thepowerFromrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DeviceInfo
public DeviceInfo(String name, int channel, boolean inverted, CANBusId canBusId, PowerSource powerFrom) Creates an instance of aDeviceInforecord class.
-
-
Method Details
-
builder
Starts a builder with no inversion, CAN_S0, and no power-source metadata. Set a non-CAN channel withDeviceInfo.Builder.withChannel(int), or a CAN address withDeviceInfo.Builder.withCanBus(CANPort, int). An unspecified channel is -1. -
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. -
name
-
channel
-
inverted
-
canBusId
-
powerFrom
-