Package com.io7m.waxmill.client.api
Class WXMClientConfiguration.Builder
java.lang.Object
com.io7m.waxmill.client.api.WXMClientConfiguration.Builder
- Enclosing class:
- WXMClientConfiguration
public static final class WXMClientConfiguration.Builder
extends java.lang.Object
Builds instances of type
WXMClientConfiguration.
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 WXMClientConfigurationbuild()Builds a newWXMClientConfiguration.WXMClientConfiguration.Builderfrom(WXMClientConfigurationType instance)Fill a builder with attribute values from the providedWXMClientConfigurationTypeinstance.WXMClientConfiguration.BuildersetBhyveExecutable(java.nio.file.Path bhyveExecutable)Initializes the value for thebhyveExecutableattribute.WXMClientConfiguration.BuildersetCuExecutable(java.nio.file.Path cuExecutable)Initializes the value for thecuExecutableattribute.WXMClientConfiguration.BuildersetGrubBhyveExecutable(java.nio.file.Path grubBhyveExecutable)Initializes the value for thegrubBhyveExecutableattribute.WXMClientConfiguration.BuildersetVirtualMachineConfigurationDirectory(java.nio.file.Path virtualMachineConfigurationDirectory)Initializes the value for thevirtualMachineConfigurationDirectoryattribute.WXMClientConfiguration.BuildersetVirtualMachineRuntimeDirectory(java.nio.file.Path virtualMachineRuntimeDirectory)Initializes the value for thevirtualMachineRuntimeDirectoryattribute.WXMClientConfiguration.BuildersetZfsExecutable(java.nio.file.Path zfsExecutable)Initializes the value for thezfsExecutableattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedWXMClientConfigurationTypeinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
setVirtualMachineConfigurationDirectory
public final WXMClientConfiguration.Builder setVirtualMachineConfigurationDirectory(java.nio.file.Path virtualMachineConfigurationDirectory)Initializes the value for thevirtualMachineConfigurationDirectoryattribute.- Parameters:
virtualMachineConfigurationDirectory- The value for virtualMachineConfigurationDirectory- Returns:
thisbuilder for use in a chained invocation
-
setVirtualMachineRuntimeDirectory
public final WXMClientConfiguration.Builder setVirtualMachineRuntimeDirectory(java.nio.file.Path virtualMachineRuntimeDirectory)Initializes the value for thevirtualMachineRuntimeDirectoryattribute.- Parameters:
virtualMachineRuntimeDirectory- The value for virtualMachineRuntimeDirectory- Returns:
thisbuilder for use in a chained invocation
-
setBhyveExecutable
Initializes the value for thebhyveExecutableattribute.If not set, this attribute will have a default value as returned by the initializer of
bhyveExecutable.- Parameters:
bhyveExecutable- The value for bhyveExecutable- Returns:
thisbuilder for use in a chained invocation
-
setGrubBhyveExecutable
public final WXMClientConfiguration.Builder setGrubBhyveExecutable(java.nio.file.Path grubBhyveExecutable)Initializes the value for thegrubBhyveExecutableattribute.If not set, this attribute will have a default value as returned by the initializer of
grubBhyveExecutable.- Parameters:
grubBhyveExecutable- The value for grubBhyveExecutable- Returns:
thisbuilder for use in a chained invocation
-
setZfsExecutable
Initializes the value for thezfsExecutableattribute.If not set, this attribute will have a default value as returned by the initializer of
zfsExecutable.- Parameters:
zfsExecutable- The value for zfsExecutable- Returns:
thisbuilder for use in a chained invocation
-
setCuExecutable
Initializes the value for thecuExecutableattribute.If not set, this attribute will have a default value as returned by the initializer of
cuExecutable.- Parameters:
cuExecutable- The value for cuExecutable- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newWXMClientConfiguration.- Returns:
- An immutable instance of WXMClientConfiguration
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-