Package com.io7m.waxmill.machines
Class WXMEvaluatedBootCommands
java.lang.Object
com.io7m.waxmill.machines.WXMEvaluatedBootCommands
- All Implemented Interfaces:
WXMBootConfigurationType.WXMEvaluatedBootCommandsType
public final class WXMEvaluatedBootCommands extends java.lang.Object implements WXMBootConfigurationType.WXMEvaluatedBootCommandsType
A set of boot commands.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWXMEvaluatedBootCommands.BuilderBuilds instances of typeWXMEvaluatedBootCommands. -
Method Summary
Modifier and Type Method Description static WXMEvaluatedBootCommands.Builderbuilder()Creates a builder forWXMEvaluatedBootCommands.java.util.List<WXMCommandExecution>configurationCommands()static WXMEvaluatedBootCommandscopyOf(WXMBootConfigurationType.WXMEvaluatedBootCommandsType instance)Creates an immutable copy of aWXMBootConfigurationType.WXMEvaluatedBootCommandsTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofWXMEvaluatedBootCommandsthat have equal attribute values.inthashCode()Computes a hash code from attributes:configurationCommands,lastExecution.java.util.Optional<WXMCommandExecution>lastExecution()The final execution to bring up the virtual machine.java.lang.StringtoString()Prints the immutable valueWXMEvaluatedBootCommandswith attribute values.WXMEvaluatedBootCommandswithConfigurationCommands(WXMCommandExecution... elements)Copy the current immutable object with elements that replace the content ofconfigurationCommands.WXMEvaluatedBootCommandswithConfigurationCommands(java.lang.Iterable<? extends WXMCommandExecution> elements)Copy the current immutable object with elements that replace the content ofconfigurationCommands.WXMEvaluatedBootCommandswithLastExecution(WXMCommandExecution value)Copy the current immutable object by setting a present value for the optionallastExecutionattribute.WXMEvaluatedBootCommandswithLastExecution(java.util.Optional<? extends WXMCommandExecution> optional)Copy the current immutable object by setting an optional value for thelastExecutionattribute.
-
Method Details
-
configurationCommands
- Specified by:
configurationCommandsin interfaceWXMBootConfigurationType.WXMEvaluatedBootCommandsType- Returns:
- A list of commands executed in declaration order to configure the virtual machine
-
lastExecution
The final execution to bring up the virtual machine. This is typically executed using the operating system's equivalent ofexecve()and will therefore replace the current process.- Specified by:
lastExecutionin interfaceWXMBootConfigurationType.WXMEvaluatedBootCommandsType- Returns:
- The final execution used to bring up the virtual machine
-
withConfigurationCommands
Copy the current immutable object with elements that replace the content ofconfigurationCommands.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withConfigurationCommands
public final WXMEvaluatedBootCommands withConfigurationCommands(java.lang.Iterable<? extends WXMCommandExecution> elements)Copy the current immutable object with elements that replace the content ofconfigurationCommands. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of configurationCommands elements to set- Returns:
- A modified copy of
thisobject
-
withLastExecution
Copy the current immutable object by setting a present value for the optionallastExecutionattribute.- Parameters:
value- The value for lastExecution- Returns:
- A modified copy of
thisobject
-
withLastExecution
public final WXMEvaluatedBootCommands withLastExecution(java.util.Optional<? extends WXMCommandExecution> optional)Copy the current immutable object by setting an optional value for thelastExecutionattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for lastExecution- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofWXMEvaluatedBootCommandsthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:configurationCommands,lastExecution.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueWXMEvaluatedBootCommandswith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static WXMEvaluatedBootCommands copyOf(WXMBootConfigurationType.WXMEvaluatedBootCommandsType instance)Creates an immutable copy of aWXMBootConfigurationType.WXMEvaluatedBootCommandsTypevalue. 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 WXMEvaluatedBootCommands instance
-
builder
Creates a builder forWXMEvaluatedBootCommands.WXMEvaluatedBootCommands.builder() .addConfigurationCommands|addAllConfigurationCommands(WXMCommandExecution) //configurationCommandselements .setLastExecution(WXMCommandExecution) // optionallastExecution.build();- Returns:
- A new WXMEvaluatedBootCommands builder
-