Class WXMMACAddressWithSide

java.lang.Object
com.io7m.waxmill.machines.WXMMACAddressWithSide
All Implemented Interfaces:
WXMMACAddressWithSideType

public final class WXMMACAddressWithSide
extends java.lang.Object
implements WXMMACAddressWithSideType
A MAC address paired with the "side" of the device to which the address is applied (such as the guest side, or host side).
  • Method Details

    • value

      public WXMMACAddress value()
      Specified by:
      value in interface WXMMACAddressWithSideType
      Returns:
      The MAC address
    • side

      public WXMSide side()
      Specified by:
      side in interface WXMMACAddressWithSideType
      Returns:
      The side of the object
    • withValue

      public final WXMMACAddressWithSide withValue​(WXMMACAddress value)
      Copy the current immutable object by setting a value for the value attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for value
      Returns:
      A modified copy of the this object
    • withSide

      public final WXMMACAddressWithSide withSide​(WXMSide value)
      Copy the current immutable object by setting a value for the side attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for side
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals​(java.lang.Object another)
      This instance is equal to all instances of WXMMACAddressWithSide 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: value, side.
      Overrides:
      hashCode in class java.lang.Object
      Returns:
      hashCode value
    • toString

      public java.lang.String toString()
      Prints the immutable value WXMMACAddressWithSide with attribute values.
      Overrides:
      toString in class java.lang.Object
      Returns:
      A string representation of the value
    • of

      public static WXMMACAddressWithSide of​(WXMMACAddress value, WXMSide side)
      Construct a new immutable WXMMACAddressWithSide instance.
      Parameters:
      value - The value for the value attribute
      side - The value for the side attribute
      Returns:
      An immutable WXMMACAddressWithSide instance
    • copyOf

      public static WXMMACAddressWithSide copyOf​(WXMMACAddressWithSideType instance)
      Creates an immutable copy of a WXMMACAddressWithSideType 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 WXMMACAddressWithSide instance
    • builder

      public static WXMMACAddressWithSide.Builder builder()
      Creates a builder for WXMMACAddressWithSide.
       WXMMACAddressWithSide.builder()
          .setValue(com.io7m.waxmill.machines.WXMMACAddress) // required value
          .setSide(com.io7m.waxmill.machines.WXMSide) // required side
          .build();
       
      Returns:
      A new WXMMACAddressWithSide builder