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.ObjectBuilds instances of typeRuntimeDescription. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods 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 Detail
-
from
public final RuntimeDescription.Builder from(RuntimeDescriptionType instance)
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
public final RuntimeDescription.Builder setRepository(java.net.URI repository)
Initializes the value for therepositoryattribute.- Parameters:
repository- The value for repository- Returns:
thisbuilder for use in a chained invocation
-
setVersion
public final RuntimeDescription.Builder setVersion(RuntimeVersion version)
Initializes the value for theversionattribute.- Parameters:
version- The value for version- Returns:
thisbuilder for use in a chained invocation
-
setConfiguration
public final RuntimeDescription.Builder setConfiguration(RuntimeConfiguration configuration)
Initializes the value for theconfigurationattribute.- Parameters:
configuration- The value for configuration- Returns:
thisbuilder for use in a chained invocation
-
setPlatform
public final RuntimeDescription.Builder setPlatform(java.lang.String platform)
Initializes the value for theplatformattribute.- Parameters:
platform- The value for platform- Returns:
thisbuilder for use in a chained invocation
-
setArchitecture
public final RuntimeDescription.Builder setArchitecture(java.lang.String architecture)
Initializes the value for thearchitectureattribute.- Parameters:
architecture- The value for architecture- Returns:
thisbuilder for use in a chained invocation
-
setArchiveURI
public final RuntimeDescription.Builder setArchiveURI(java.net.URI archiveURI)
Initializes the value for thearchiveURIattribute.- Parameters:
archiveURI- The value for archiveURI- Returns:
thisbuilder for use in a chained invocation
-
setArchiveSize
public final RuntimeDescription.Builder setArchiveSize(long archiveSize)
Initializes the value for thearchiveSizeattribute.- Parameters:
archiveSize- The value for archiveSize- Returns:
thisbuilder for use in a chained invocation
-
setArchiveHash
public final RuntimeDescription.Builder setArchiveHash(RuntimeHash archiveHash)
Initializes the value for thearchiveHashattribute.- Parameters:
archiveHash- The value for archiveHash- Returns:
thisbuilder for use in a chained invocation
-
setVm
public final RuntimeDescription.Builder setVm(java.lang.String vm)
Initializes the value for thevmattribute.- Parameters:
vm- The value for vm- Returns:
thisbuilder for use in a chained invocation
-
setBuild
public final RuntimeDescription.Builder setBuild(RuntimeBuild build)
Initializes the optional valuebuildto build.- Parameters:
build- The value for build- Returns:
thisbuilder for chained invocation
-
setBuild
public final RuntimeDescription.Builder setBuild(java.util.Optional<? extends RuntimeBuild> build)
Initializes the optional valuebuildto build.- Parameters:
build- The value for build- Returns:
thisbuilder for use in a chained invocation
-
addTags
public final RuntimeDescription.Builder addTags(java.lang.String element)
Adds one element totagsset.- Parameters:
element- A tags element- Returns:
thisbuilder for use in a chained invocation
-
addTags
public final RuntimeDescription.Builder addTags(java.lang.String... elements)
Adds elements totagsset.- Parameters:
elements- An array of tags elements- Returns:
thisbuilder for use in a chained invocation
-
setTags
public final RuntimeDescription.Builder setTags(java.lang.Iterable<java.lang.String> elements)
Sets or replaces all elements fortagsset.- Parameters:
elements- An iterable of tags elements- Returns:
thisbuilder for use in a chained invocation
-
addAllTags
public final RuntimeDescription.Builder addAllTags(java.lang.Iterable<java.lang.String> elements)
Adds elements totagsset.- Parameters:
elements- An iterable of tags elements- Returns:
thisbuilder for use in a chained invocation
-
build
public RuntimeDescription build()
Builds a newRuntimeDescription.- Returns:
- An immutable instance of RuntimeDescription
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
-