Package com.io7m.waxmill.machines
Class WXMTap
java.lang.Object
com.io7m.waxmill.machines.WXMTap
- All Implemented Interfaces:
WXMNetworkDeviceBackendType,WXMTapType
public final class WXMTap extends java.lang.Object implements 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.WXMNetworkDeviceBackendType
WXMNetworkDeviceBackendType.Kind -
Method Summary
Modifier and Type Method Description static WXMTap.Builderbuilder()Creates a builder forWXMTap.java.lang.Stringcomment()static WXMTapcopyOf(WXMTapType instance)Creates an immutable copy of aWXMTapTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofWXMTapthat have equal attribute values.java.util.List<WXMInterfaceGroupName>groups()WXMMACAddressguestMAC()inthashCode()Computes a hash code from attributes:name,guestMAC,hostMAC,groups,comment.WXMMACAddresshostMAC()WXMTAPDeviceNamename()java.lang.StringtoString()Prints the immutable valueWXMTapwith attribute values.WXMTapwithComment(java.lang.String value)Copy the current immutable object by setting a value for thecommentattribute.WXMTapwithGroups(WXMInterfaceGroupName... elements)Copy the current immutable object with elements that replace the content ofgroups.WXMTapwithGroups(java.lang.Iterable<? extends WXMInterfaceGroupName> elements)Copy the current immutable object with elements that replace the content ofgroups.WXMTapwithGuestMAC(WXMMACAddress value)Copy the current immutable object by setting a value for theguestMACattribute.WXMTapwithHostMAC(WXMMACAddress value)Copy the current immutable object by setting a value for thehostMACattribute.WXMTapwithName(WXMTAPDeviceName value)Copy the current immutable object by setting a value for thenameattribute.
-
Method Details
-
name
- Specified by:
namein interfaceWXMTapType- Returns:
- The underlying device name
-
guestMAC
- Specified by:
guestMACin interfaceWXMNetworkDeviceBackendType- Specified by:
guestMACin interfaceWXMTapType- Returns:
- The value of the
guestMACattribute
-
hostMAC
- Specified by:
hostMACin interfaceWXMNetworkDeviceBackendType- Specified by:
hostMACin interfaceWXMTapType- Returns:
- The value of the
hostMACattribute
-
groups
- Specified by:
groupsin interfaceWXMNetworkDeviceBackendType- Specified by:
groupsin interfaceWXMTapType- Returns:
- The value of the
groupsattribute
-
comment
public java.lang.String comment()- Specified by:
commentin interfaceWXMNetworkDeviceBackendType- Specified by:
commentin interfaceWXMTapType- 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
-
withGuestMAC
Copy the current immutable object by setting a value for theguestMACattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for guestMAC- Returns:
- A modified copy of the
thisobject
-
withHostMAC
Copy the current immutable object by setting a value for thehostMACattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for hostMAC- Returns:
- A modified copy of the
thisobject
-
withGroups
Copy the current immutable object with elements that replace the content ofgroups.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withGroups
Copy the current immutable object with elements that replace the content ofgroups. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of groups elements to set- Returns:
- A modified copy of
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,guestMAC,hostMAC,groups,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 aWXMTapTypevalue. 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.setGuestMAC(com.io7m.waxmill.machines.WXMMACAddress) // requiredguestMAC.setHostMAC(com.io7m.waxmill.machines.WXMMACAddress) // requiredhostMAC.addGroups|addAllGroups(WXMInterfaceGroupName) //groupselements .setComment(String) // optionalcomment.build();- Returns:
- A new WXMTap builder
-