Package com.io7m.waxmill.machines
Class WXMGRUBKernelLinux.Builder
java.lang.Object
com.io7m.waxmill.machines.WXMGRUBKernelLinux.Builder
- Enclosing class:
- WXMGRUBKernelLinux
public static final class WXMGRUBKernelLinux.Builder
extends java.lang.Object
Builds instances of type
WXMGRUBKernelLinux.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and Type Method Description WXMGRUBKernelLinux.BuilderaddAllKernelArguments(java.lang.Iterable<java.lang.String> elements)Adds elements tokernelArgumentslist.WXMGRUBKernelLinux.BuilderaddKernelArguments(java.lang.String element)Adds one element tokernelArgumentslist.WXMGRUBKernelLinux.BuilderaddKernelArguments(java.lang.String... elements)Adds elements tokernelArgumentslist.WXMGRUBKernelLinuxbuild()Builds a newWXMGRUBKernelLinux.WXMGRUBKernelLinux.Builderfrom(WXMBootConfigurationType.WXMGRUBKernelLinuxType instance)Fill a builder with attribute values from the providedWXMGRUBKernelLinuxTypeinstance.WXMGRUBKernelLinux.BuildersetInitRDDevice(WXMDeviceSlot initRDDevice)Initializes the value for theinitRDDeviceattribute.WXMGRUBKernelLinux.BuildersetInitRDPath(java.nio.file.Path initRDPath)Initializes the value for theinitRDPathattribute.WXMGRUBKernelLinux.BuildersetKernelArguments(java.lang.Iterable<java.lang.String> elements)Sets or replaces all elements forkernelArgumentslist.WXMGRUBKernelLinux.BuildersetKernelDevice(WXMDeviceSlot kernelDevice)Initializes the value for thekernelDeviceattribute.WXMGRUBKernelLinux.BuildersetKernelPath(java.nio.file.Path kernelPath)Initializes the value for thekernelPathattribute.
-
Method Details
-
from
public final WXMGRUBKernelLinux.Builder from(WXMBootConfigurationType.WXMGRUBKernelLinuxType instance)Fill a builder with attribute values from the providedWXMGRUBKernelLinuxTypeinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
setKernelDevice
Initializes the value for thekernelDeviceattribute.- Parameters:
kernelDevice- The value for kernelDevice- Returns:
thisbuilder for use in a chained invocation
-
setKernelPath
Initializes the value for thekernelPathattribute.- Parameters:
kernelPath- The value for kernelPath- Returns:
thisbuilder for use in a chained invocation
-
addKernelArguments
Adds one element tokernelArgumentslist.- Parameters:
element- A kernelArguments element- Returns:
thisbuilder for use in a chained invocation
-
addKernelArguments
Adds elements tokernelArgumentslist.- Parameters:
elements- An array of kernelArguments elements- Returns:
thisbuilder for use in a chained invocation
-
setKernelArguments
public final WXMGRUBKernelLinux.Builder setKernelArguments(java.lang.Iterable<java.lang.String> elements)Sets or replaces all elements forkernelArgumentslist.- Parameters:
elements- An iterable of kernelArguments elements- Returns:
thisbuilder for use in a chained invocation
-
addAllKernelArguments
public final WXMGRUBKernelLinux.Builder addAllKernelArguments(java.lang.Iterable<java.lang.String> elements)Adds elements tokernelArgumentslist.- Parameters:
elements- An iterable of kernelArguments elements- Returns:
thisbuilder for use in a chained invocation
-
setInitRDDevice
Initializes the value for theinitRDDeviceattribute.- Parameters:
initRDDevice- The value for initRDDevice- Returns:
thisbuilder for use in a chained invocation
-
setInitRDPath
Initializes the value for theinitRDPathattribute.- Parameters:
initRDPath- The value for initRDPath- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newWXMGRUBKernelLinux.- Returns:
- An immutable instance of WXMGRUBKernelLinux
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-