Package com.io7m.coffeepick.runtime
Class RuntimeRepositoryDescription
java.lang.Object
com.io7m.coffeepick.runtime.RuntimeRepositoryDescription
- All Implemented Interfaces:
RuntimeRepositoryDescriptionType
public final class RuntimeRepositoryDescription extends java.lang.Object implements RuntimeRepositoryDescriptionType
A repository of runtimes.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RuntimeRepositoryDescription.Builder
Builds instances of typeRuntimeRepositoryDescription
. -
Method Summary
Modifier and Type Method Description RuntimeRepositoryBranding
branding()
static RuntimeRepositoryDescription.Builder
builder()
Creates a builder forRuntimeRepositoryDescription
.static RuntimeRepositoryDescription
copyOf(RuntimeRepositoryDescriptionType instance)
Creates an immutable copy of aRuntimeRepositoryDescriptionType
value.boolean
equals(java.lang.Object another)
This instance is equal to all instances ofRuntimeRepositoryDescription
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:id
,updated
,runtimes
,branding
.java.net.URI
id()
java.util.Map<java.lang.String,RuntimeDescription>
runtimes()
java.lang.String
toString()
Prints the immutable valueRuntimeRepositoryDescription
with attribute values.java.util.Optional<java.time.OffsetDateTime>
updated()
RuntimeRepositoryDescription
withBranding(RuntimeRepositoryBranding value)
Copy the current immutable object by setting a value for thebranding
attribute.RuntimeRepositoryDescription
withId(java.net.URI value)
Copy the current immutable object by setting a value for theid
attribute.RuntimeRepositoryDescription
withRuntimes(java.util.Map<java.lang.String,? extends RuntimeDescription> entries)
Copy the current immutable object by replacing theruntimes
map with the specified map.RuntimeRepositoryDescription
withUpdated(java.time.OffsetDateTime value)
Copy the current immutable object by setting a present value for the optionalupdated
attribute.RuntimeRepositoryDescription
withUpdated(java.util.Optional<? extends java.time.OffsetDateTime> optional)
Copy the current immutable object by setting an optional value for theupdated
attribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.io7m.coffeepick.runtime.RuntimeRepositoryDescriptionType
checkPreconditions
-
Method Details
-
id
public java.net.URI id()- Specified by:
id
in interfaceRuntimeRepositoryDescriptionType
- Returns:
- The unique ID of the repository
-
updated
public java.util.Optional<java.time.OffsetDateTime> updated()- Specified by:
updated
in interfaceRuntimeRepositoryDescriptionType
- Returns:
- The time of the last update of the repository
-
runtimes
- Specified by:
runtimes
in interfaceRuntimeRepositoryDescriptionType
- Returns:
- The runtimes available in the repository
-
branding
- Specified by:
branding
in interfaceRuntimeRepositoryDescriptionType
- Returns:
- Branding information for the repository
-
withId
Copy the current immutable object by setting a value for theid
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for id- Returns:
- A modified copy of the
this
object
-
withUpdated
Copy the current immutable object by setting a present value for the optionalupdated
attribute.- Parameters:
value
- The value for updated- Returns:
- A modified copy of
this
object
-
withUpdated
public final RuntimeRepositoryDescription withUpdated(java.util.Optional<? extends java.time.OffsetDateTime> optional)Copy the current immutable object by setting an optional value for theupdated
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 updated- Returns:
- A modified copy of
this
object
-
withRuntimes
public final RuntimeRepositoryDescription withRuntimes(java.util.Map<java.lang.String,? extends RuntimeDescription> entries)Copy the current immutable object by replacing theruntimes
map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
entries
- The entries to be added to the runtimes map- Returns:
- A modified copy of
this
object
-
withBranding
Copy the current immutable object by setting a value for thebranding
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for branding- Returns:
- A modified copy of the
this
object
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofRuntimeRepositoryDescription
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:id
,updated
,runtimes
,branding
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueRuntimeRepositoryDescription
with attribute values.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of the value
-
copyOf
Creates an immutable copy of aRuntimeRepositoryDescriptionType
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 RuntimeRepositoryDescription instance
-
builder
Creates a builder forRuntimeRepositoryDescription
.RuntimeRepositoryDescription.builder() .setId(java.net.URI) // required
id
.setUpdated(java.time.OffsetDateTime) // optionalupdated
.putRuntimes|putAllRuntimes(String => RuntimeDescription) //runtimes
mappings .setBranding(com.io7m.coffeepick.runtime.RuntimeRepositoryBranding) // requiredbranding
.build();- Returns:
- A new RuntimeRepositoryDescription builder
-