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 class
RuntimeDescription.Builder
Builds instances of typeRuntimeDescription
. -
Method Summary
Modifier and Type Method Description java.lang.String
architecture()
RuntimeHash
archiveHash()
long
archiveSize()
java.net.URI
archiveURI()
java.util.Optional<RuntimeBuild>
build()
static RuntimeDescription.Builder
builder()
Creates a builder forRuntimeDescription
.RuntimeConfiguration
configuration()
static RuntimeDescription
copyOf(RuntimeDescriptionType instance)
Creates an immutable copy of aRuntimeDescriptionType
value.boolean
equals(java.lang.Object another)
This instance is equal to all instances ofRuntimeDescription
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:repository
,version
,configuration
,platform
,architecture
,archiveURI
,archiveSize
,archiveHash
,vm
,build
,tags
.java.lang.String
platform()
java.net.URI
repository()
java.util.Set<java.lang.String>
tags()
java.lang.String
toString()
Prints the immutable valueRuntimeDescription
with attribute values.RuntimeVersion
version()
java.lang.String
vm()
RuntimeDescription
withArchitecture(java.lang.String value)
Copy the current immutable object by setting a value for thearchitecture
attribute.RuntimeDescription
withArchiveHash(RuntimeHash value)
Copy the current immutable object by setting a value for thearchiveHash
attribute.RuntimeDescription
withArchiveSize(long value)
Copy the current immutable object by setting a value for thearchiveSize
attribute.RuntimeDescription
withArchiveURI(java.net.URI value)
Copy the current immutable object by setting a value for thearchiveURI
attribute.RuntimeDescription
withBuild(RuntimeBuild value)
Copy the current immutable object by setting a present value for the optionalbuild
attribute.RuntimeDescription
withBuild(java.util.Optional<? extends RuntimeBuild> optional)
Copy the current immutable object by setting an optional value for thebuild
attribute.RuntimeDescription
withConfiguration(RuntimeConfiguration value)
Copy the current immutable object by setting a value for theconfiguration
attribute.RuntimeDescription
withPlatform(java.lang.String value)
Copy the current immutable object by setting a value for theplatform
attribute.RuntimeDescription
withRepository(java.net.URI value)
Copy the current immutable object by setting a value for therepository
attribute.RuntimeDescription
withTags(java.lang.Iterable<java.lang.String> elements)
Copy the current immutable object with elements that replace the content oftags
.RuntimeDescription
withTags(java.lang.String... elements)
Copy the current immutable object with elements that replace the content oftags
.RuntimeDescription
withVersion(RuntimeVersion value)
Copy the current immutable object by setting a value for theversion
attribute.RuntimeDescription
withVm(java.lang.String value)
Copy the current immutable object by setting a value for thevm
attribute.
-
Method Details
-
repository
public java.net.URI repository()- Specified by:
repository
in interfaceRuntimeDescriptionType
- Returns:
- The repository to which this runtime belongs
-
version
- Specified by:
version
in interfaceRuntimeDescriptionType
- Returns:
- The runtime version
-
configuration
- Specified by:
configuration
in interfaceRuntimeDescriptionType
- Returns:
- The JVM configuration
-
platform
public java.lang.String platform()- Specified by:
platform
in interfaceRuntimeDescriptionType
- Returns:
- The name of the platform upon which this runtime will run
- See Also:
RuntimePlatforms
-
architecture
public java.lang.String architecture()- Specified by:
architecture
in interfaceRuntimeDescriptionType
- Returns:
- The name of the architecture upon which this runtime will run
- See Also:
RuntimeArchitectures
-
archiveURI
public java.net.URI archiveURI()- Specified by:
archiveURI
in interfaceRuntimeDescriptionType
- Returns:
- A URI that can be used to fetch an archive of the runtime
-
archiveSize
public long archiveSize()- Specified by:
archiveSize
in interfaceRuntimeDescriptionType
- Returns:
- The size in octets of the archive
-
archiveHash
- Specified by:
archiveHash
in interfaceRuntimeDescriptionType
- Returns:
- The hash of the runtime
-
vm
public java.lang.String vm()- Specified by:
vm
in interfaceRuntimeDescriptionType
- Returns:
- The name of the VM used in the runtime
- See Also:
RuntimeVMs
-
build
- Specified by:
build
in interfaceRuntimeDescriptionType
- Returns:
- The build information
-
tags
public java.util.Set<java.lang.String> tags()- Specified by:
tags
in interfaceRuntimeDescriptionType
- Returns:
- A set of arbitrary tags added to the runtime
-
withRepository
Copy the current immutable object by setting a value for therepository
attribute. 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
this
object
-
withVersion
Copy the current immutable object by setting a value for theversion
attribute. 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
this
object
-
withConfiguration
Copy the current immutable object by setting a value for theconfiguration
attribute. 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
this
object
-
withPlatform
Copy the current immutable object by setting a value for theplatform
attribute. 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
this
object
-
withArchitecture
Copy the current immutable object by setting a value for thearchitecture
attribute. 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
this
object
-
withArchiveURI
Copy the current immutable object by setting a value for thearchiveURI
attribute. 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
this
object
-
withArchiveSize
Copy the current immutable object by setting a value for thearchiveSize
attribute. 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
this
object
-
withArchiveHash
Copy the current immutable object by setting a value for thearchiveHash
attribute. 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
this
object
-
withVm
Copy the current immutable object by setting a value for thevm
attribute. 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
this
object
-
withBuild
Copy the current immutable object by setting a present value for the optionalbuild
attribute.- Parameters:
value
- The value for build- Returns:
- A modified copy of
this
object
-
withBuild
Copy the current immutable object by setting an optional value for thebuild
attribute. 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
this
object
-
withTags
Copy the current immutable object with elements that replace the content oftags
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
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
this
object
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofRuntimeDescription
that have equal attribute values.- Overrides:
equals
in classjava.lang.Object
- Returns:
true
ifthis
is equal toanother
instance
-
hashCode
public int hashCode()Computes a hash code from attributes:repository
,version
,configuration
,platform
,architecture
,archiveURI
,archiveSize
,archiveHash
,vm
,build
,tags
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueRuntimeDescription
with attribute values.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of the value
-
copyOf
Creates an immutable copy of aRuntimeDescriptionType
value. 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) // required
repository
.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) //tags
elements .build();- Returns:
- A new RuntimeDescription builder
-