Package com.io7m.coffeepick.runtime
Class RuntimeDescription.Builder
java.lang.Object
com.io7m.coffeepick.runtime.RuntimeDescription.Builder
- Enclosing class:
- RuntimeDescription
public static final class RuntimeDescription.Builder
extends java.lang.Object
Builds instances of type
RuntimeDescription.
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 RuntimeDescription.BuilderaddAllTags(java.lang.Iterable<java.lang.String> elements)Adds elements totagsset.RuntimeDescription.BuilderaddTags(java.lang.String element)Adds one element totagsset.RuntimeDescription.BuilderaddTags(java.lang.String... elements)Adds elements totagsset.RuntimeDescriptionbuild()Builds a newRuntimeDescription.RuntimeDescription.Builderfrom(RuntimeDescriptionType instance)Fill a builder with attribute values from the providedRuntimeDescriptionTypeinstance.RuntimeDescription.BuildersetArchitecture(java.lang.String architecture)Initializes the value for thearchitectureattribute.RuntimeDescription.BuildersetArchiveHash(RuntimeHash archiveHash)Initializes the value for thearchiveHashattribute.RuntimeDescription.BuildersetArchiveSize(long archiveSize)Initializes the value for thearchiveSizeattribute.RuntimeDescription.BuildersetArchiveURI(java.net.URI archiveURI)Initializes the value for thearchiveURIattribute.RuntimeDescription.BuildersetBuild(RuntimeBuild build)Initializes the optional valuebuildto build.RuntimeDescription.BuildersetBuild(java.util.Optional<? extends RuntimeBuild> build)Initializes the optional valuebuildto build.RuntimeDescription.BuildersetConfiguration(RuntimeConfiguration configuration)Initializes the value for theconfigurationattribute.RuntimeDescription.BuildersetPlatform(java.lang.String platform)Initializes the value for theplatformattribute.RuntimeDescription.BuildersetRepository(java.net.URI repository)Initializes the value for therepositoryattribute.RuntimeDescription.BuildersetTags(java.lang.Iterable<java.lang.String> elements)Sets or replaces all elements fortagsset.RuntimeDescription.BuildersetVersion(RuntimeVersion version)Initializes the value for theversionattribute.RuntimeDescription.BuildersetVm(java.lang.String vm)Initializes the value for thevmattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedRuntimeDescriptionTypeinstance. 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
-
setRepository
Initializes the value for therepositoryattribute.- Parameters:
repository- The value for repository- Returns:
thisbuilder for use in a chained invocation
-
setVersion
Initializes the value for theversionattribute.- Parameters:
version- The value for version- Returns:
thisbuilder for use in a chained invocation
-
setConfiguration
Initializes the value for theconfigurationattribute.- Parameters:
configuration- The value for configuration- Returns:
thisbuilder for use in a chained invocation
-
setPlatform
Initializes the value for theplatformattribute.- Parameters:
platform- The value for platform- Returns:
thisbuilder for use in a chained invocation
-
setArchitecture
Initializes the value for thearchitectureattribute.- Parameters:
architecture- The value for architecture- Returns:
thisbuilder for use in a chained invocation
-
setArchiveURI
Initializes the value for thearchiveURIattribute.- Parameters:
archiveURI- The value for archiveURI- Returns:
thisbuilder for use in a chained invocation
-
setArchiveSize
Initializes the value for thearchiveSizeattribute.- Parameters:
archiveSize- The value for archiveSize- Returns:
thisbuilder for use in a chained invocation
-
setArchiveHash
Initializes the value for thearchiveHashattribute.- Parameters:
archiveHash- The value for archiveHash- Returns:
thisbuilder for use in a chained invocation
-
setVm
Initializes the value for thevmattribute.- Parameters:
vm- The value for vm- Returns:
thisbuilder for use in a chained invocation
-
setBuild
Initializes the optional valuebuildto build.- Parameters:
build- The value for build- Returns:
thisbuilder for chained invocation
-
setBuild
Initializes the optional valuebuildto build.- Parameters:
build- The value for build- Returns:
thisbuilder for use in a chained invocation
-
addTags
Adds one element totagsset.- Parameters:
element- A tags element- Returns:
thisbuilder for use in a chained invocation
-
addTags
Adds elements totagsset.- Parameters:
elements- An array of tags elements- Returns:
thisbuilder for use in a chained invocation
-
setTags
Sets or replaces all elements fortagsset.- Parameters:
elements- An iterable of tags elements- Returns:
thisbuilder for use in a chained invocation
-
addAllTags
Adds elements totagsset.- Parameters:
elements- An iterable of tags elements- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newRuntimeDescription.- Returns:
- An immutable instance of RuntimeDescription
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-