Package com.io7m.waxmill.xml.vm.v1
Class WXM1LinuxKernelDevice
java.lang.Object
com.io7m.waxmill.xml.vm.v1.WXM1LinuxKernelDevice
- All Implemented Interfaces:
WXM1LinuxKernelDeviceType
public final class WXM1LinuxKernelDevice extends java.lang.Object implements WXM1LinuxKernelDeviceType
Immutable implementation of
WXM1LinuxKernelDeviceType.
Use the builder to create immutable instances:
WXM1LinuxKernelDevice.builder().
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWXM1LinuxKernelDevice.BuilderBuilds instances of typeWXM1LinuxKernelDevice. -
Method Summary
Modifier and Type Method Description static WXM1LinuxKernelDevice.Builderbuilder()Creates a builder forWXM1LinuxKernelDevice.static WXM1LinuxKernelDevicecopyOf(WXM1LinuxKernelDeviceType instance)Creates an immutable copy of aWXM1LinuxKernelDeviceTypevalue.WXMDeviceSlotdeviceSlot()booleanequals(java.lang.Object another)This instance is equal to all instances ofWXM1LinuxKernelDevicethat have equal attribute values.inthashCode()Computes a hash code from attributes:deviceSlot,kernelPath.java.nio.file.PathkernelPath()java.lang.StringtoString()Prints the immutable valueWXM1LinuxKernelDevicewith attribute values.WXM1LinuxKernelDevicewithDeviceSlot(WXMDeviceSlot value)Copy the current immutable object by setting a value for thedeviceSlotattribute.WXM1LinuxKernelDevicewithKernelPath(java.nio.file.Path value)Copy the current immutable object by setting a value for thekernelPathattribute.
-
Method Details
-
deviceSlot
- Specified by:
deviceSlotin interfaceWXM1LinuxKernelDeviceType- Returns:
- The value of the
deviceSlotattribute
-
kernelPath
public java.nio.file.Path kernelPath()- Specified by:
kernelPathin interfaceWXM1LinuxKernelDeviceType- Returns:
- The value of the
kernelPathattribute
-
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
-
withKernelPath
Copy the current immutable object by setting a value for thekernelPathattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for kernelPath- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofWXM1LinuxKernelDevicethat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:deviceSlot,kernelPath.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueWXM1LinuxKernelDevicewith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
Creates an immutable copy of aWXM1LinuxKernelDeviceTypevalue. 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 WXM1LinuxKernelDevice instance
-
builder
Creates a builder forWXM1LinuxKernelDevice.WXM1LinuxKernelDevice.builder() .setDeviceSlot(com.io7m.waxmill.machines.WXMDeviceSlot) // requireddeviceSlot.setKernelPath(java.nio.file.Path) // requiredkernelPath.build();- Returns:
- A new WXM1LinuxKernelDevice builder
-