Package com.io7m.waxmill.machines
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.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWXMTap.BuilderBuilds instances of typeWXMTap.Nested classes/interfaces inherited from interface com.io7m.waxmill.machines.WXMDeviceType.WXMNetworkDeviceBackendType
WXMDeviceType.WXMNetworkDeviceBackendType.Kind -
Method Summary
Modifier and Type Method Description WXMMACAddressaddress()static WXMTap.Builderbuilder()Creates a builder forWXMTap.java.lang.Stringcomment()static WXMTapcopyOf(WXMDeviceType.WXMTapType instance)Creates an immutable copy of aWXMDeviceType.WXMTapTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofWXMTapthat have equal attribute values.inthashCode()Computes a hash code from attributes:name,address,comment.WXMTAPDeviceNamename()java.lang.StringtoString()Prints the immutable valueWXMTapwith attribute values.WXMTapwithAddress(WXMMACAddress value)Copy the current immutable object by setting a value for theaddressattribute.WXMTapwithComment(java.lang.String value)Copy the current immutable object by setting a value for thecommentattribute.WXMTapwithName(WXMTAPDeviceName value)Copy the current immutable object by setting a value for thenameattribute.
-
Method Details
-
name
- Specified by:
namein interfaceWXMDeviceType.WXMTapType- Returns:
- The underlying device name
-
address
- Specified by:
addressin interfaceWXMDeviceType.WXMTapType- Returns:
- The underlying device MAC address
-
comment
public java.lang.String comment()- Specified by:
commentin interfaceWXMDeviceType.WXMNetworkDeviceBackendType- Specified by:
commentin interfaceWXMDeviceType.WXMTapType- Returns:
- The value of the
commentattribute
-
withName
Copy the current immutable object by setting a value for thenameattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy of the
thisobject
-
withAddress
Copy the current immutable object by setting a value for theaddressattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for address- Returns:
- A modified copy of the
thisobject
-
withComment
Copy the current immutable object by setting a value for thecommentattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for comment- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofWXMTapthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:name,address,comment.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueWXMTapwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
Creates an immutable copy of aWXMDeviceType.WXMTapTypevalue. 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
Creates a builder forWXMTap.WXMTap.builder() .setName(com.io7m.waxmill.machines.WXMTAPDeviceName) // requiredname.setAddress(com.io7m.waxmill.machines.WXMMACAddress) // requiredaddress.setComment(String) // optionalcomment.build();- Returns:
- A new WXMTap builder
-