Package com.io7m.waxmill.client.api
Class WXMClientConfiguration
java.lang.Object
com.io7m.waxmill.client.api.WXMClientConfiguration
- All Implemented Interfaces:
WXMClientConfigurationType
public final class WXMClientConfiguration extends java.lang.Object implements WXMClientConfigurationType
Configuration values passed to the client.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWXMClientConfiguration.BuilderBuilds instances of typeWXMClientConfiguration. -
Method Summary
Modifier and Type Method Description java.nio.file.PathbhyveCtlExecutable()java.nio.file.PathbhyveExecutable()static WXMClientConfiguration.Builderbuilder()Creates a builder forWXMClientConfiguration.static WXMClientConfigurationcopyOf(WXMClientConfigurationType instance)Creates an immutable copy of aWXMClientConfigurationTypevalue.java.nio.file.PathcuExecutable()booleanequals(java.lang.Object another)This instance is equal to all instances ofWXMClientConfigurationthat have equal attribute values.java.nio.file.PathgrubBhyveExecutable()inthashCode()Computes a hash code from attributes:virtualMachineConfigurationDirectory,virtualMachineRuntimeDirectory,bhyveExecutable,bhyveCtlExecutable,grubBhyveExecutable,zfsExecutable,cuExecutable.java.lang.StringtoString()Prints the immutable valueWXMClientConfigurationwith attribute values.java.nio.file.PathvirtualMachineConfigurationDirectory()A directory that contains virtual machine configurations.java.nio.file.PathvirtualMachineRuntimeDirectory()A directory that contains virtual machines.WXMClientConfigurationwithBhyveCtlExecutable(java.nio.file.Path value)Copy the current immutable object by setting a value for thebhyveCtlExecutableattribute.WXMClientConfigurationwithBhyveExecutable(java.nio.file.Path value)Copy the current immutable object by setting a value for thebhyveExecutableattribute.WXMClientConfigurationwithCuExecutable(java.nio.file.Path value)Copy the current immutable object by setting a value for thecuExecutableattribute.WXMClientConfigurationwithGrubBhyveExecutable(java.nio.file.Path value)Copy the current immutable object by setting a value for thegrubBhyveExecutableattribute.WXMClientConfigurationwithVirtualMachineConfigurationDirectory(java.nio.file.Path value)Copy the current immutable object by setting a value for thevirtualMachineConfigurationDirectoryattribute.WXMClientConfigurationwithVirtualMachineRuntimeDirectory(java.nio.file.Path value)Copy the current immutable object by setting a value for thevirtualMachineRuntimeDirectoryattribute.WXMClientConfigurationwithZfsExecutable(java.nio.file.Path value)Copy the current immutable object by setting a value for thezfsExecutableattribute.java.nio.file.PathzfsExecutable()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.io7m.waxmill.client.api.WXMClientConfigurationType
checkPreconditions, virtualMachineRuntimeDirectoryFor
-
Method Details
-
virtualMachineConfigurationDirectory
public java.nio.file.Path virtualMachineConfigurationDirectory()A directory that contains virtual machine configurations.- Specified by:
virtualMachineConfigurationDirectoryin interfaceWXMClientConfigurationType- Returns:
- The virtual machine configuration directory
-
virtualMachineRuntimeDirectory
public java.nio.file.Path virtualMachineRuntimeDirectory()A directory that contains virtual machines. This directory will contain one ZFS filesystem per virtual machine.- Specified by:
virtualMachineRuntimeDirectoryin interfaceWXMClientConfigurationType- Returns:
- The ZFS directory containing virtual machines
-
bhyveExecutable
public java.nio.file.Path bhyveExecutable()- Specified by:
bhyveExecutablein interfaceWXMClientConfigurationType- Returns:
- The "bhyve" executable path, such as
/usr/sbin/bhyve
-
bhyveCtlExecutable
public java.nio.file.Path bhyveCtlExecutable()- Specified by:
bhyveCtlExecutablein interfaceWXMClientConfigurationType- Returns:
- The "bhyvectl" executable path, such as
/usr/sbin/bhyvectl
-
grubBhyveExecutable
public java.nio.file.Path grubBhyveExecutable()- Specified by:
grubBhyveExecutablein interfaceWXMClientConfigurationType- Returns:
- The "grub-bhyve" executable path, such as
/usr/local/sbin/grub-bhyve
-
zfsExecutable
public java.nio.file.Path zfsExecutable()- Specified by:
zfsExecutablein interfaceWXMClientConfigurationType- Returns:
- The "zfs" executable path, such as
/sbin/zfs
-
cuExecutable
public java.nio.file.Path cuExecutable()- Specified by:
cuExecutablein interfaceWXMClientConfigurationType- Returns:
- The "cu" executable path, such as
/usr/bin/cu
-
withVirtualMachineConfigurationDirectory
public final WXMClientConfiguration withVirtualMachineConfigurationDirectory(java.nio.file.Path value)Copy the current immutable object by setting a value for thevirtualMachineConfigurationDirectoryattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for virtualMachineConfigurationDirectory- Returns:
- A modified copy of the
thisobject
-
withVirtualMachineRuntimeDirectory
Copy the current immutable object by setting a value for thevirtualMachineRuntimeDirectoryattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for virtualMachineRuntimeDirectory- Returns:
- A modified copy of the
thisobject
-
withBhyveExecutable
Copy the current immutable object by setting a value for thebhyveExecutableattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for bhyveExecutable- Returns:
- A modified copy of the
thisobject
-
withBhyveCtlExecutable
Copy the current immutable object by setting a value for thebhyveCtlExecutableattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for bhyveCtlExecutable- Returns:
- A modified copy of the
thisobject
-
withGrubBhyveExecutable
Copy the current immutable object by setting a value for thegrubBhyveExecutableattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for grubBhyveExecutable- Returns:
- A modified copy of the
thisobject
-
withZfsExecutable
Copy the current immutable object by setting a value for thezfsExecutableattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for zfsExecutable- Returns:
- A modified copy of the
thisobject
-
withCuExecutable
Copy the current immutable object by setting a value for thecuExecutableattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for cuExecutable- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofWXMClientConfigurationthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:virtualMachineConfigurationDirectory,virtualMachineRuntimeDirectory,bhyveExecutable,bhyveCtlExecutable,grubBhyveExecutable,zfsExecutable,cuExecutable.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueWXMClientConfigurationwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
Creates an immutable copy of aWXMClientConfigurationTypevalue. 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 WXMClientConfiguration instance
-
builder
Creates a builder forWXMClientConfiguration.WXMClientConfiguration.builder() .setVirtualMachineConfigurationDirectory(java.nio.file.Path) // requiredvirtualMachineConfigurationDirectory.setVirtualMachineRuntimeDirectory(java.nio.file.Path) // requiredvirtualMachineRuntimeDirectory.setBhyveExecutable(java.nio.file.Path) // optionalbhyveExecutable.setBhyveCtlExecutable(java.nio.file.Path) // optionalbhyveCtlExecutable.setGrubBhyveExecutable(java.nio.file.Path) // optionalgrubBhyveExecutable.setZfsExecutable(java.nio.file.Path) // optionalzfsExecutable.setCuExecutable(java.nio.file.Path) // optionalcuExecutable.build();- Returns:
- A new WXMClientConfiguration builder
-