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.
  • 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

      public final WXMDeviceSlot withBusID​(int value)
      Copy the current immutable object by setting a value for the busID attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for busID
      Returns:
      A modified copy of the this object
    • withSlotID

      public final WXMDeviceSlot withSlotID​(int value)
      Copy the current immutable object by setting a value for the slotID attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for slotID
      Returns:
      A modified copy of the this object
    • withFunctionID

      public final WXMDeviceSlot withFunctionID​(int value)
      Copy the current immutable object by setting a value for the functionID attribute. A value equality check is used to prevent copying of the same value by returning this.
      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 of WXMDeviceSlot that have equal attribute values.
      Overrides:
      equals in class java.lang.Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: busID, slotID, functionID.
      Overrides:
      hashCode in class java.lang.Object
      Returns:
      hashCode value
    • copyOf

      public static WXMDeviceSlot copyOf​(WXMDeviceSlotType instance)
      Creates an immutable copy of a WXMDeviceSlotType 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

      public static WXMDeviceSlot.Builder builder()
      Creates a builder for WXMDeviceSlot.
       WXMDeviceSlot.builder()
          .setBusID(int) // required busID
          .setSlotID(int) // required slotID
          .setFunctionID(int) // required functionID
          .build();
       
      Returns:
      A new WXMDeviceSlot builder