Record Class DeviceAddress
java.lang.Object
java.lang.Record
xbot.common.injection.DeviceAddress
- Record Components:
type- device typecanBus- CAN bus, present only for CAN deviceschannel- channel or device number
public record DeviceAddress(DevicePolice.DeviceType type, Optional<CANBusId> canBus, int channel)
extends Record
A channel reservation, including the bus for CAN devices. Native bus identities are accepted directly by
can(CANPort, int).
Factories describe a request without throwing for invalid channel or bus values. DevicePolice validates the complete request before reserving any channels.
-
Constructor Summary
ConstructorsConstructorDescriptionDeviceAddress(DevicePolice.DeviceType type, Optional<CANBusId> canBus, int channel) Creates an instance of aDeviceAddressrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic DeviceAddresscan(org.wpilib.hardware.bus.CANPort port, int channel) static DeviceAddresscanBus()Returns the value of thecanBusrecord component.intchannel()Returns the value of thechannelrecord component.static DeviceAddresschannel(DevicePolice.DeviceType type, int channel) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.Returns a validation error, or empty for a valid address.
-
Constructor Details
-
Method Details
-
can
-
can
-
channel
-
validationError
-
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. -
type
-
canBus
-
channel
-