Package com.io7m.waxmill.machines
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).
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWXMMACAddressWithSide.BuilderBuilds instances of typeWXMMACAddressWithSide. -
Method Summary
Modifier and Type Method Description static WXMMACAddressWithSide.Builderbuilder()Creates a builder forWXMMACAddressWithSide.static WXMMACAddressWithSidecopyOf(WXMMACAddressWithSideType instance)Creates an immutable copy of aWXMMACAddressWithSideTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofWXMMACAddressWithSidethat have equal attribute values.inthashCode()Computes a hash code from attributes:value,side.static WXMMACAddressWithSideof(WXMMACAddress value, WXMSide side)Construct a new immutableWXMMACAddressWithSideinstance.WXMSideside()java.lang.StringtoString()Prints the immutable valueWXMMACAddressWithSidewith attribute values.WXMMACAddressvalue()WXMMACAddressWithSidewithSide(WXMSide value)Copy the current immutable object by setting a value for thesideattribute.WXMMACAddressWithSidewithValue(WXMMACAddress value)Copy the current immutable object by setting a value for thevalueattribute.
-
Method Details
-
value
- Specified by:
valuein interfaceWXMMACAddressWithSideType- Returns:
- The MAC address
-
side
- Specified by:
sidein interfaceWXMMACAddressWithSideType- Returns:
- The side of the object
-
withValue
Copy the current immutable object by setting a value for thevalueattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for value- Returns:
- A modified copy of the
thisobject
-
withSide
Copy the current immutable object by setting a value for thesideattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for side- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofWXMMACAddressWithSidethat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:value,side.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueWXMMACAddressWithSidewith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
Construct a new immutableWXMMACAddressWithSideinstance.- Parameters:
value- The value for thevalueattributeside- The value for thesideattribute- Returns:
- An immutable WXMMACAddressWithSide instance
-
copyOf
Creates an immutable copy of aWXMMACAddressWithSideTypevalue. 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
Creates a builder forWXMMACAddressWithSide.WXMMACAddressWithSide.builder() .setValue(com.io7m.waxmill.machines.WXMMACAddress) // requiredvalue.setSide(com.io7m.waxmill.machines.WXMSide) // requiredside.build();- Returns:
- A new WXMMACAddressWithSide builder
-