Package com.io7m.coffeepick.runtime
Class RuntimeDescription
java.lang.Object
com.io7m.coffeepick.runtime.RuntimeDescription
- All Implemented Interfaces:
RuntimeDescriptionType
public final class RuntimeDescription extends java.lang.Object implements RuntimeDescriptionType
A runtimes of a runtime.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRuntimeDescription.BuilderBuilds instances of typeRuntimeDescription. -
Method Summary
Modifier and Type Method Description java.lang.Stringarchitecture()RuntimeHasharchiveHash()longarchiveSize()java.net.URIarchiveURI()java.util.Optional<RuntimeBuild>build()static RuntimeDescription.Builderbuilder()Creates a builder forRuntimeDescription.RuntimeConfigurationconfiguration()static RuntimeDescriptioncopyOf(RuntimeDescriptionType instance)Creates an immutable copy of aRuntimeDescriptionTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofRuntimeDescriptionthat have equal attribute values.inthashCode()Computes a hash code from attributes:repository,version,configuration,platform,architecture,archiveURI,archiveSize,archiveHash,vm,build,tags.java.lang.Stringplatform()java.net.URIrepository()java.util.Set<java.lang.String>tags()java.lang.StringtoString()Prints the immutable valueRuntimeDescriptionwith attribute values.RuntimeVersionversion()java.lang.Stringvm()RuntimeDescriptionwithArchitecture(java.lang.String value)Copy the current immutable object by setting a value for thearchitectureattribute.RuntimeDescriptionwithArchiveHash(RuntimeHash value)Copy the current immutable object by setting a value for thearchiveHashattribute.RuntimeDescriptionwithArchiveSize(long value)Copy the current immutable object by setting a value for thearchiveSizeattribute.RuntimeDescriptionwithArchiveURI(java.net.URI value)Copy the current immutable object by setting a value for thearchiveURIattribute.RuntimeDescriptionwithBuild(RuntimeBuild value)Copy the current immutable object by setting a present value for the optionalbuildattribute.RuntimeDescriptionwithBuild(java.util.Optional<? extends RuntimeBuild> optional)Copy the current immutable object by setting an optional value for thebuildattribute.RuntimeDescriptionwithConfiguration(RuntimeConfiguration value)Copy the current immutable object by setting a value for theconfigurationattribute.RuntimeDescriptionwithPlatform(java.lang.String value)Copy the current immutable object by setting a value for theplatformattribute.RuntimeDescriptionwithRepository(java.net.URI value)Copy the current immutable object by setting a value for therepositoryattribute.RuntimeDescriptionwithTags(java.lang.Iterable<java.lang.String> elements)Copy the current immutable object with elements that replace the content oftags.RuntimeDescriptionwithTags(java.lang.String... elements)Copy the current immutable object with elements that replace the content oftags.RuntimeDescriptionwithVersion(RuntimeVersion value)Copy the current immutable object by setting a value for theversionattribute.RuntimeDescriptionwithVm(java.lang.String value)Copy the current immutable object by setting a value for thevmattribute.
-
Method Details
-
repository
public java.net.URI repository()- Specified by:
repositoryin interfaceRuntimeDescriptionType- Returns:
- The repository to which this runtime belongs
-
version
- Specified by:
versionin interfaceRuntimeDescriptionType- Returns:
- The runtime version
-
configuration
- Specified by:
configurationin interfaceRuntimeDescriptionType- Returns:
- The JVM configuration
-
platform
public java.lang.String platform()- Specified by:
platformin interfaceRuntimeDescriptionType- Returns:
- The name of the platform upon which this runtime will run
- See Also:
RuntimePlatforms
-
architecture
public java.lang.String architecture()- Specified by:
architecturein interfaceRuntimeDescriptionType- Returns:
- The name of the architecture upon which this runtime will run
- See Also:
RuntimeArchitectures
-
archiveURI
public java.net.URI archiveURI()- Specified by:
archiveURIin interfaceRuntimeDescriptionType- Returns:
- A URI that can be used to fetch an archive of the runtime
-
archiveSize
public long archiveSize()- Specified by:
archiveSizein interfaceRuntimeDescriptionType- Returns:
- The size in octets of the archive
-
archiveHash
- Specified by:
archiveHashin interfaceRuntimeDescriptionType- Returns:
- The hash of the runtime
-
vm
public java.lang.String vm()- Specified by:
vmin interfaceRuntimeDescriptionType- Returns:
- The name of the VM used in the runtime
- See Also:
RuntimeVMs
-
build
- Specified by:
buildin interfaceRuntimeDescriptionType- Returns:
- The build information
-
tags
public java.util.Set<java.lang.String> tags()- Specified by:
tagsin interfaceRuntimeDescriptionType- Returns:
- A set of arbitrary tags added to the runtime
-
withRepository
Copy the current immutable object by setting a value for therepositoryattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for repository- Returns:
- A modified copy of the
thisobject
-
withVersion
Copy the current immutable object by setting a value for theversionattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for version- Returns:
- A modified copy of the
thisobject
-
withConfiguration
Copy the current immutable object by setting a value for theconfigurationattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for configuration- Returns:
- A modified copy of the
thisobject
-
withPlatform
Copy the current immutable object by setting a value for theplatformattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for platform- Returns:
- A modified copy of the
thisobject
-
withArchitecture
Copy the current immutable object by setting a value for thearchitectureattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for architecture- Returns:
- A modified copy of the
thisobject
-
withArchiveURI
Copy the current immutable object by setting a value for thearchiveURIattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for archiveURI- Returns:
- A modified copy of the
thisobject
-
withArchiveSize
Copy the current immutable object by setting a value for thearchiveSizeattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for archiveSize- Returns:
- A modified copy of the
thisobject
-
withArchiveHash
Copy the current immutable object by setting a value for thearchiveHashattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for archiveHash- Returns:
- A modified copy of the
thisobject
-
withVm
Copy the current immutable object by setting a value for thevmattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for vm- Returns:
- A modified copy of the
thisobject
-
withBuild
Copy the current immutable object by setting a present value for the optionalbuildattribute.- Parameters:
value- The value for build- Returns:
- A modified copy of
thisobject
-
withBuild
Copy the current immutable object by setting an optional value for thebuildattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for build- Returns:
- A modified copy of
thisobject
-
withTags
Copy the current immutable object with elements that replace the content oftags.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withTags
Copy the current immutable object with elements that replace the content oftags. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of tags elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofRuntimeDescriptionthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:repository,version,configuration,platform,architecture,archiveURI,archiveSize,archiveHash,vm,build,tags.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueRuntimeDescriptionwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
Creates an immutable copy of aRuntimeDescriptionTypevalue. 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 RuntimeDescription instance
-
builder
Creates a builder forRuntimeDescription.RuntimeDescription.builder() .setRepository(java.net.URI) // requiredrepository.setVersion(com.io7m.coffeepick.runtime.RuntimeVersion) // requiredversion.setConfiguration(com.io7m.coffeepick.runtime.RuntimeConfiguration) // requiredconfiguration.setPlatform(String) // requiredplatform.setArchitecture(String) // requiredarchitecture.setArchiveURI(java.net.URI) // requiredarchiveURI.setArchiveSize(long) // requiredarchiveSize.setArchiveHash(com.io7m.coffeepick.runtime.RuntimeHash) // requiredarchiveHash.setVm(String) // requiredvm.setBuild(RuntimeBuild) // optionalbuild.addTags|addAllTags(String) //tagselements .build();- Returns:
- A new RuntimeDescription builder
-