Package com.io7m.waxmill.machines
Class WXMDeviceLPC
java.lang.Object
com.io7m.waxmill.machines.WXMDeviceLPC
- All Implemented Interfaces:
WXMDeviceType,WXMDeviceType.WXMDeviceLPCType
public final class WXMDeviceLPC extends java.lang.Object implements WXMDeviceType.WXMDeviceLPCType
Immutable implementation of
WXMDeviceType.WXMDeviceLPCType.
Use the builder to create immutable instances:
WXMDeviceLPC.builder().
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWXMDeviceLPC.BuilderBuilds instances of typeWXMDeviceLPC.Nested classes/interfaces inherited from interface com.io7m.waxmill.machines.WXMDeviceType
WXMDeviceType.Kind, WXMDeviceType.WXMDeviceAHCIDiskType, WXMDeviceType.WXMDeviceAHCIOpticalDiskType, WXMDeviceType.WXMDeviceE1000Type, WXMDeviceType.WXMDeviceFramebufferType, WXMDeviceType.WXMDeviceHostBridgeType, WXMDeviceType.WXMDeviceLPCType, WXMDeviceType.WXMDeviceNetworkType, WXMDeviceType.WXMDevicePassthruType, WXMDeviceType.WXMDeviceVirtioBlockStorageType, WXMDeviceType.WXMDeviceVirtioNetworkType, WXMDeviceType.WXMLPCTTYNames, WXMDeviceType.WXMSectorSizesType, WXMDeviceType.WXMStorageBackendFileType, WXMDeviceType.WXMStorageBackendType, WXMDeviceType.WXMStorageBackendZFSVolumeType, WXMDeviceType.WXMTTYBackendFileType, WXMDeviceType.WXMTTYBackendNMDMType, WXMDeviceType.WXMTTYBackendStdioType, WXMDeviceType.WXMTTYBackendType -
Method Summary
Modifier and Type Method Description java.util.Map<java.lang.String,WXMDeviceType.WXMTTYBackendType>backendMap()java.util.List<WXMDeviceType.WXMTTYBackendType>backends()static WXMDeviceLPC.Builderbuilder()Creates a builder forWXMDeviceLPC.java.lang.Stringcomment()static WXMDeviceLPCcopyOf(WXMDeviceType.WXMDeviceLPCType instance)Creates an immutable copy of aWXMDeviceType.WXMDeviceLPCTypevalue.WXMDeviceSlotdeviceSlot()booleanequals(java.lang.Object another)This instance is equal to all instances ofWXMDeviceLPCthat have equal attribute values.inthashCode()Computes a hash code from attributes:deviceSlot,comment,backends.java.lang.StringtoString()Prints the immutable valueWXMDeviceLPCwith attribute values.WXMDeviceLPCwithBackends(WXMDeviceType.WXMTTYBackendType... elements)Copy the current immutable object with elements that replace the content ofbackends.WXMDeviceLPCwithBackends(java.lang.Iterable<? extends WXMDeviceType.WXMTTYBackendType> elements)Copy the current immutable object with elements that replace the content ofbackends.WXMDeviceLPCwithComment(java.lang.String value)Copy the current immutable object by setting a value for thecommentattribute.WXMDeviceLPCwithDeviceSlot(WXMDeviceSlot value)Copy the current immutable object by setting a value for thedeviceSlotattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.io7m.waxmill.machines.WXMDeviceType
isConsoleDevice, isStorageDeviceMethods inherited from interface com.io7m.waxmill.machines.WXMDeviceType.WXMDeviceLPCType
checkPreconditions, externalName, kind
-
Method Details
-
deviceSlot
- Specified by:
deviceSlotin interfaceWXMDeviceType- Specified by:
deviceSlotin interfaceWXMDeviceType.WXMDeviceLPCType- Returns:
- The value of the
deviceSlotattribute
-
comment
public java.lang.String comment()- Specified by:
commentin interfaceWXMDeviceType- Specified by:
commentin interfaceWXMDeviceType.WXMDeviceLPCType- Returns:
- The value of the
commentattribute
-
backends
- Specified by:
backendsin interfaceWXMDeviceType.WXMDeviceLPCType- Returns:
- The value of the
backendsattribute
-
backendMap
- Specified by:
backendMapin interfaceWXMDeviceType.WXMDeviceLPCType- Returns:
- The computed-at-construction value of the
backendMapattribute
-
withDeviceSlot
Copy the current immutable object by setting a value for thedeviceSlotattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for deviceSlot- 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
-
withBackends
Copy the current immutable object with elements that replace the content ofbackends.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withBackends
public final WXMDeviceLPC withBackends(java.lang.Iterable<? extends WXMDeviceType.WXMTTYBackendType> elements)Copy the current immutable object with elements that replace the content ofbackends. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of backends elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofWXMDeviceLPCthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:deviceSlot,comment,backends.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueWXMDeviceLPCwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
Creates an immutable copy of aWXMDeviceType.WXMDeviceLPCTypevalue. 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 WXMDeviceLPC instance
-
builder
Creates a builder forWXMDeviceLPC.WXMDeviceLPC.builder() .setDeviceSlot(com.io7m.waxmill.machines.WXMDeviceSlot) // requireddeviceSlot.setComment(String) // optionalcomment.addBackends|addAllBackends(com.io7m.waxmill.machines.WXMDeviceType.WXMTTYBackendType) //backendselements .build();- Returns:
- A new WXMDeviceLPC builder
-