Class WXMTap

java.lang.Object
com.io7m.waxmill.machines.WXMTap
All Implemented Interfaces:
WXMDeviceType.WXMNetworkDeviceBackendType, WXMDeviceType.WXMTapType

public final class WXMTap
extends java.lang.Object
implements WXMDeviceType.WXMTapType
A TAP device.
  • Method Details

    • name

      public WXMTAPDeviceName name()
      Specified by:
      name in interface WXMDeviceType.WXMTapType
      Returns:
      The underlying device name
    • address

      public WXMMACAddress address()
      Specified by:
      address in interface WXMDeviceType.WXMTapType
      Returns:
      The underlying device MAC address
    • comment

      public java.lang.String comment()
      Specified by:
      comment in interface WXMDeviceType.WXMNetworkDeviceBackendType
      Specified by:
      comment in interface WXMDeviceType.WXMTapType
      Returns:
      The value of the comment attribute
    • withName

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

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

      public final WXMTap withComment​(java.lang.String value)
      Copy the current immutable object by setting a value for the comment attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for comment
      Returns:
      A modified copy of the this object
    • equals

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

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

      public static WXMTap copyOf​(WXMDeviceType.WXMTapType instance)
      Creates an immutable copy of a WXMDeviceType.WXMTapType 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 WXMTap instance
    • builder

      public static WXMTap.Builder builder()
      Creates a builder for WXMTap.
       WXMTap.builder()
          .setName(com.io7m.waxmill.machines.WXMTAPDeviceName) // required name
          .setAddress(com.io7m.waxmill.machines.WXMMACAddress) // required address
          .setComment(String) // optional comment
          .build();
       
      Returns:
      A new WXMTap builder