Package com.io7m.waxmill.machines
Class WXMStorageBackendFile.Builder
java.lang.Object
com.io7m.waxmill.machines.WXMStorageBackendFile.Builder
- Enclosing class:
- WXMStorageBackendFile
public static final class WXMStorageBackendFile.Builder
extends java.lang.Object
Builds instances of type
WXMStorageBackendFile.
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 WXMStorageBackendFile.BuilderaddAllOptions(java.lang.Iterable<WXMOpenOption> elements)Adds elements tooptionsset.WXMStorageBackendFile.BuilderaddOptions(WXMOpenOption element)Adds one element tooptionsset.WXMStorageBackendFile.BuilderaddOptions(WXMOpenOption... elements)Adds elements tooptionsset.WXMStorageBackendFilebuild()Builds a newWXMStorageBackendFile.WXMStorageBackendFile.Builderfrom(WXMDeviceType.WXMStorageBackendFileType instance)Fill a builder with attribute values from the providedcom.io7m.waxmill.machines.WXMDeviceType.WXMStorageBackendFileTypeinstance.WXMStorageBackendFile.Builderfrom(WXMDeviceType.WXMStorageBackendType instance)Fill a builder with attribute values from the providedcom.io7m.waxmill.machines.WXMDeviceType.WXMStorageBackendTypeinstance.WXMStorageBackendFile.BuildersetComment(java.lang.String comment)Initializes the value for thecommentattribute.WXMStorageBackendFile.BuildersetFile(java.nio.file.Path file)Initializes the value for thefileattribute.WXMStorageBackendFile.BuildersetOptions(java.lang.Iterable<WXMOpenOption> elements)Sets or replaces all elements foroptionsset.WXMStorageBackendFile.BuildersetSectorSizes(WXMSectorSizes sectorSizes)Initializes the optional valuesectorSizesto sectorSizes.WXMStorageBackendFile.BuildersetSectorSizes(java.util.Optional<? extends WXMSectorSizes> sectorSizes)Initializes the optional valuesectorSizesto sectorSizes.
-
Method Details
-
from
Fill a builder with attribute values from the providedcom.io7m.waxmill.machines.WXMDeviceType.WXMStorageBackendFileTypeinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
Fill a builder with attribute values from the providedcom.io7m.waxmill.machines.WXMDeviceType.WXMStorageBackendTypeinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
setFile
Initializes the value for thefileattribute.- Parameters:
file- The value for file- Returns:
thisbuilder for use in a chained invocation
-
addOptions
Adds one element tooptionsset.- Parameters:
element- A options element- Returns:
thisbuilder for use in a chained invocation
-
addOptions
Adds elements tooptionsset.- Parameters:
elements- An array of options elements- Returns:
thisbuilder for use in a chained invocation
-
setOptions
Sets or replaces all elements foroptionsset.- Parameters:
elements- An iterable of options elements- Returns:
thisbuilder for use in a chained invocation
-
addAllOptions
public final WXMStorageBackendFile.Builder addAllOptions(java.lang.Iterable<WXMOpenOption> elements)Adds elements tooptionsset.- Parameters:
elements- An iterable of options elements- Returns:
thisbuilder for use in a chained invocation
-
setSectorSizes
Initializes the optional valuesectorSizesto sectorSizes.- Parameters:
sectorSizes- The value for sectorSizes- Returns:
thisbuilder for chained invocation
-
setSectorSizes
public final WXMStorageBackendFile.Builder setSectorSizes(java.util.Optional<? extends WXMSectorSizes> sectorSizes)Initializes the optional valuesectorSizesto sectorSizes.- Parameters:
sectorSizes- The value for sectorSizes- Returns:
thisbuilder for use in a chained invocation
-
setComment
Initializes the value for thecommentattribute.If not set, this attribute will have a default value as returned by the initializer of
comment.- Parameters:
comment- The value for comment- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newWXMStorageBackendFile.- Returns:
- An immutable instance of WXMStorageBackendFile
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-