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 classWXMDeviceSlot.BuilderBuilds 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.Builderbuilder()Creates a builder forWXMDeviceSlot.intbusID()static WXMDeviceSlotcopyOf(WXMDeviceSlotType instance)Creates an immutable copy of aWXMDeviceSlotTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofWXMDeviceSlotthat have equal attribute values.intfunctionID()inthashCode()Computes a hash code from attributes:busID,slotID,functionID.intslotID()WXMDeviceSlotwithBusID(int value)Copy the current immutable object by setting a value for thebusIDattribute.WXMDeviceSlotwithFunctionID(int value)Copy the current immutable object by setting a value for thefunctionIDattribute.WXMDeviceSlotwithSlotID(int value)Copy the current immutable object by setting a value for theslotIDattribute.
-
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 thebusIDattribute. 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
thisobject
-
withSlotID
Copy the current immutable object by setting a value for theslotIDattribute. 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
thisobject
-
withFunctionID
Copy the current immutable object by setting a value for thefunctionIDattribute. 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
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofWXMDeviceSlotthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:busID,slotID,functionID.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
copyOf
Creates an immutable copy of aWXMDeviceSlotTypevalue. 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) // requiredbusID.setSlotID(int) // requiredslotID.setFunctionID(int) // requiredfunctionID.build();- Returns:
- A new WXMDeviceSlot builder
-