Package com.io7m.montarre.adoptium
Class MEARuntime.Builder
java.lang.Object
com.io7m.montarre.adoptium.MEARuntime.Builder
- Enclosing class:
MEARuntime
Builds instances of type
MEARuntime.
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 TypeMethodDescriptionbuild()Builds a newMEARuntime.final MEARuntime.Builderfrom(MEARuntimeType instance) Fill a builder with attribute values from the providedMEARuntimeTypeinstance.final MEARuntime.BuildersetArchitecture(MArchitectureName architecture) Initializes the value for thearchitectureattribute.final MEARuntime.BuildersetDownloadLink(URI downloadLink) Initializes the value for thedownloadLinkattribute.final MEARuntime.BuildersetFormat(MArchiveFormat format) Initializes the value for theformatattribute.final MEARuntime.BuilderInitializes the value for thehashattribute.final MEARuntime.BuildersetOperatingSystem(MOperatingSystemName operatingSystem) Initializes the value for theoperatingSystemattribute.final MEARuntime.BuildersetSize(long size) Initializes the value for thesizeattribute.final MEARuntime.BuildersetVersion(Runtime.Version version) Initializes the value for theversionattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedMEARuntimeTypeinstance. 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
-
setHash
Initializes the value for thehashattribute.- Parameters:
hash- The value for hash- Returns:
thisbuilder for use in a chained invocation
-
setDownloadLink
Initializes the value for thedownloadLinkattribute.- Parameters:
downloadLink- The value for downloadLink- Returns:
thisbuilder for use in a chained invocation
-
setSize
Initializes the value for thesizeattribute.- Parameters:
size- The value for size- 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
-
setOperatingSystem
Initializes the value for theoperatingSystemattribute.- Parameters:
operatingSystem- The value for operatingSystem- Returns:
thisbuilder for use in a chained invocation
-
setFormat
Initializes the value for theformatattribute.- Parameters:
format- The value for format- 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
-
build
Builds a newMEARuntime.- Returns:
- An immutable instance of MEARuntime
- Throws:
IllegalStateException- if any required attributes are missing
-