Package com.io7m.waxmill.machines
Class WXMDeviceSlot
java.lang.Object
com.io7m.waxmill.machines.WXMDeviceSlotType
com.io7m.waxmill.machines.WXMDeviceSlot
- All Implemented Interfaces:
java.lang.Comparable<WXMDeviceSlotType>
public final class WXMDeviceSlot extends WXMDeviceSlotType
A device slot. A device is uniquely identified by the PCI bus, slot, and
function to which it is attached.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WXMDeviceSlot.Builder
Builds instances of typeWXMDeviceSlot
. -
Field Summary
Fields inherited from class com.io7m.waxmill.machines.WXMDeviceSlotType
VALID_BUS_IDS, VALID_FUNCTION_IDS, VALID_SLOT_IDS
-
Method Summary
Modifier and Type Method Description static WXMDeviceSlot.Builder
builder()
Creates a builder forWXMDeviceSlot
.int
busID()
static WXMDeviceSlot
copyOf(WXMDeviceSlotType instance)
Creates an immutable copy of aWXMDeviceSlotType
value.boolean
equals(java.lang.Object another)
This instance is equal to all instances ofWXMDeviceSlot
that have equal attribute values.int
functionID()
int
hashCode()
Computes a hash code from attributes:busID
,slotID
,functionID
.int
slotID()
WXMDeviceSlot
withBusID(int value)
Copy the current immutable object by setting a value for thebusID
attribute.WXMDeviceSlot
withFunctionID(int value)
Copy the current immutable object by setting a value for thefunctionID
attribute.WXMDeviceSlot
withSlotID(int value)
Copy the current immutable object by setting a value for theslotID
attribute.
-
Method Details
-
busID
public int busID()- Returns:
- The PCI bus ID
-
slotID
public int slotID()- Returns:
- The PCI slot ID
-
functionID
public int functionID()- Returns:
- The PCI function ID
-
withBusID
Copy the current immutable object by setting a value for thebusID
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for busID- Returns:
- A modified copy of the
this
object
-
withSlotID
Copy the current immutable object by setting a value for theslotID
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for slotID- Returns:
- A modified copy of the
this
object
-
withFunctionID
Copy the current immutable object by setting a value for thefunctionID
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for functionID- Returns:
- A modified copy of the
this
object
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofWXMDeviceSlot
that have equal attribute values.- Overrides:
equals
in classjava.lang.Object
- Returns:
true
ifthis
is equal toanother
instance
-
hashCode
public int hashCode()Computes a hash code from attributes:busID
,slotID
,functionID
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashCode value
-
copyOf
Creates an immutable copy of aWXMDeviceSlotType
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable WXMDeviceSlot instance
-
builder
Creates a builder forWXMDeviceSlot
.WXMDeviceSlot.builder() .setBusID(int) // required
busID
.setSlotID(int) // requiredslotID
.setFunctionID(int) // requiredfunctionID
.build();- Returns:
- A new WXMDeviceSlot builder
-