Package com.io7m.coffeepick.api
Class CoffeePickSearch
java.lang.Object
com.io7m.coffeepick.api.CoffeePickSearch
- All Implemented Interfaces:
CoffeePickSearchType
public final class CoffeePickSearch extends java.lang.Object implements CoffeePickSearchType
Inventory search parameters.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CoffeePickSearch.Builder
Builds instances of typeCoffeePickSearch
. -
Method Summary
Modifier and Type Method Description java.util.Optional<java.lang.String>
architecture()
java.util.Optional<RuntimeHash>
archiveHash()
java.util.OptionalLong
archiveSize()
java.util.Optional<java.net.URI>
archiveURI()
static CoffeePickSearch.Builder
builder()
Creates a builder forCoffeePickSearch
.java.util.Optional<RuntimeConfiguration>
configuration()
static CoffeePickSearch
copyOf(CoffeePickSearchType instance)
Creates an immutable copy of aCoffeePickSearchType
value.boolean
equals(java.lang.Object another)
This instance is equal to all instances ofCoffeePickSearch
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:repository
,versionRange
,platform
,architecture
,vm
,configuration
,archiveURI
,archiveSize
,archiveHash
,id
,requiredTags
.java.util.Optional<java.lang.String>
id()
java.util.Optional<java.lang.String>
platform()
java.util.Optional<java.lang.String>
repository()
java.util.Set<java.lang.String>
requiredTags()
java.lang.String
toString()
Prints the immutable valueCoffeePickSearch
with attribute values.java.util.Optional<RuntimeVersionRange>
versionRange()
java.util.Optional<java.lang.String>
vm()
CoffeePickSearch
withArchitecture(java.lang.String value)
Copy the current immutable object by setting a present value for the optionalarchitecture
attribute.CoffeePickSearch
withArchitecture(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for thearchitecture
attribute.CoffeePickSearch
withArchiveHash(RuntimeHash value)
Copy the current immutable object by setting a present value for the optionalarchiveHash
attribute.CoffeePickSearch
withArchiveHash(java.util.Optional<? extends RuntimeHash> optional)
Copy the current immutable object by setting an optional value for thearchiveHash
attribute.CoffeePickSearch
withArchiveSize(long value)
Copy the current immutable object by setting a present value for the optionalarchiveSize
attribute.CoffeePickSearch
withArchiveSize(java.util.OptionalLong optional)
Copy the current immutable object by setting an optional value for thearchiveSize
attribute.CoffeePickSearch
withArchiveURI(java.net.URI value)
Copy the current immutable object by setting a present value for the optionalarchiveURI
attribute.CoffeePickSearch
withArchiveURI(java.util.Optional<? extends java.net.URI> optional)
Copy the current immutable object by setting an optional value for thearchiveURI
attribute.CoffeePickSearch
withConfiguration(RuntimeConfiguration value)
Copy the current immutable object by setting a present value for the optionalconfiguration
attribute.CoffeePickSearch
withConfiguration(java.util.Optional<? extends RuntimeConfiguration> optional)
Copy the current immutable object by setting an optional value for theconfiguration
attribute.CoffeePickSearch
withId(java.lang.String value)
Copy the current immutable object by setting a present value for the optionalid
attribute.CoffeePickSearch
withId(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for theid
attribute.CoffeePickSearch
withPlatform(java.lang.String value)
Copy the current immutable object by setting a present value for the optionalplatform
attribute.CoffeePickSearch
withPlatform(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for theplatform
attribute.CoffeePickSearch
withRepository(java.lang.String value)
Copy the current immutable object by setting a present value for the optionalrepository
attribute.CoffeePickSearch
withRepository(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for therepository
attribute.CoffeePickSearch
withRequiredTags(java.lang.Iterable<java.lang.String> elements)
Copy the current immutable object with elements that replace the content ofrequiredTags
.CoffeePickSearch
withRequiredTags(java.lang.String... elements)
Copy the current immutable object with elements that replace the content ofrequiredTags
.CoffeePickSearch
withVersionRange(RuntimeVersionRange value)
Copy the current immutable object by setting a present value for the optionalversionRange
attribute.CoffeePickSearch
withVersionRange(java.util.Optional<? extends RuntimeVersionRange> optional)
Copy the current immutable object by setting an optional value for theversionRange
attribute.CoffeePickSearch
withVm(java.lang.String value)
Copy the current immutable object by setting a present value for the optionalvm
attribute.CoffeePickSearch
withVm(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for thevm
attribute.
-
Method Details
-
repository
public java.util.Optional<java.lang.String> repository()- Specified by:
repository
in interfaceCoffeePickSearchType
- Returns:
- The repository URI
-
versionRange
- Specified by:
versionRange
in interfaceCoffeePickSearchType
- Returns:
- The range of acceptable runtime versions
-
platform
public java.util.Optional<java.lang.String> platform()- Specified by:
platform
in interfaceCoffeePickSearchType
- Returns:
- The name of the platform upon which this runtime will run
-
architecture
public java.util.Optional<java.lang.String> architecture()- Specified by:
architecture
in interfaceCoffeePickSearchType
- Returns:
- The name of the architecture upon which this runtime will run
-
vm
public java.util.Optional<java.lang.String> vm()- Specified by:
vm
in interfaceCoffeePickSearchType
- Returns:
- The name of the VM used for this runtime
-
configuration
- Specified by:
configuration
in interfaceCoffeePickSearchType
- Returns:
- The configuration of the runtime
-
archiveURI
public java.util.Optional<java.net.URI> archiveURI()- Specified by:
archiveURI
in interfaceCoffeePickSearchType
- Returns:
- A URI that can be used to fetch an archive of the runtime
-
archiveSize
public java.util.OptionalLong archiveSize()- Specified by:
archiveSize
in interfaceCoffeePickSearchType
- Returns:
- The size in octets of the archive
-
archiveHash
- Specified by:
archiveHash
in interfaceCoffeePickSearchType
- Returns:
- The hash of the runtime
-
id
public java.util.Optional<java.lang.String> id()- Specified by:
id
in interfaceCoffeePickSearchType
- Returns:
- The unique identifier of the runtime
-
requiredTags
public java.util.Set<java.lang.String> requiredTags()- Specified by:
requiredTags
in interfaceCoffeePickSearchType
- Returns:
- A set of tags that must be present on a given runtime
-
withRepository
Copy the current immutable object by setting a present value for the optionalrepository
attribute.- Parameters:
value
- The value for repository- Returns:
- A modified copy of
this
object
-
withRepository
Copy the current immutable object by setting an optional value for therepository
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for repository- Returns:
- A modified copy of
this
object
-
withVersionRange
Copy the current immutable object by setting a present value for the optionalversionRange
attribute.- Parameters:
value
- The value for versionRange- Returns:
- A modified copy of
this
object
-
withVersionRange
public final CoffeePickSearch withVersionRange(java.util.Optional<? extends RuntimeVersionRange> optional)Copy the current immutable object by setting an optional value for theversionRange
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 versionRange- Returns:
- A modified copy of
this
object
-
withPlatform
Copy the current immutable object by setting a present value for the optionalplatform
attribute.- Parameters:
value
- The value for platform- Returns:
- A modified copy of
this
object
-
withPlatform
Copy the current immutable object by setting an optional value for theplatform
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for platform- Returns:
- A modified copy of
this
object
-
withArchitecture
Copy the current immutable object by setting a present value for the optionalarchitecture
attribute.- Parameters:
value
- The value for architecture- Returns:
- A modified copy of
this
object
-
withArchitecture
Copy the current immutable object by setting an optional value for thearchitecture
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for architecture- Returns:
- A modified copy of
this
object
-
withVm
Copy the current immutable object by setting a present value for the optionalvm
attribute.- Parameters:
value
- The value for vm- Returns:
- A modified copy of
this
object
-
withVm
Copy the current immutable object by setting an optional value for thevm
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for vm- Returns:
- A modified copy of
this
object
-
withConfiguration
Copy the current immutable object by setting a present value for the optionalconfiguration
attribute.- Parameters:
value
- The value for configuration- Returns:
- A modified copy of
this
object
-
withConfiguration
public final CoffeePickSearch withConfiguration(java.util.Optional<? extends RuntimeConfiguration> optional)Copy the current immutable object by setting an optional value for theconfiguration
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for configuration- Returns:
- A modified copy of
this
object
-
withArchiveURI
Copy the current immutable object by setting a present value for the optionalarchiveURI
attribute.- Parameters:
value
- The value for archiveURI- Returns:
- A modified copy of
this
object
-
withArchiveURI
Copy the current immutable object by setting an optional value for thearchiveURI
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 archiveURI- Returns:
- A modified copy of
this
object
-
withArchiveSize
Copy the current immutable object by setting a present value for the optionalarchiveSize
attribute.- Parameters:
value
- The value for archiveSize- Returns:
- A modified copy of
this
object
-
withArchiveSize
Copy the current immutable object by setting an optional value for thearchiveSize
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for archiveSize- Returns:
- A modified copy of
this
object
-
withArchiveHash
Copy the current immutable object by setting a present value for the optionalarchiveHash
attribute.- Parameters:
value
- The value for archiveHash- Returns:
- A modified copy of
this
object
-
withArchiveHash
Copy the current immutable object by setting an optional value for thearchiveHash
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 archiveHash- Returns:
- A modified copy of
this
object
-
withId
Copy the current immutable object by setting a present value for the optionalid
attribute.- Parameters:
value
- The value for id- Returns:
- A modified copy of
this
object
-
withId
Copy the current immutable object by setting an optional value for theid
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for id- Returns:
- A modified copy of
this
object
-
withRequiredTags
Copy the current immutable object with elements that replace the content ofrequiredTags
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withRequiredTags
Copy the current immutable object with elements that replace the content ofrequiredTags
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of requiredTags 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 ofCoffeePickSearch
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
,versionRange
,platform
,architecture
,vm
,configuration
,archiveURI
,archiveSize
,archiveHash
,id
,requiredTags
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueCoffeePickSearch
with attribute values.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of the value
-
copyOf
Creates an immutable copy of aCoffeePickSearchType
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 CoffeePickSearch instance
-
builder
Creates a builder forCoffeePickSearch
.CoffeePickSearch.builder() .setRepository(String) // optional
repository
.setVersionRange(com.io7m.coffeepick.runtime.RuntimeVersionRange) // optionalversionRange
.setPlatform(String) // optionalplatform
.setArchitecture(String) // optionalarchitecture
.setVm(String) // optionalvm
.setConfiguration(com.io7m.coffeepick.runtime.RuntimeConfiguration) // optionalconfiguration
.setArchiveURI(java.net.URI) // optionalarchiveURI
.setArchiveSize(long) // optionalarchiveSize
.setArchiveHash(com.io7m.coffeepick.runtime.RuntimeHash) // optionalarchiveHash
.setId(String) // optionalid
.addRequiredTags|addAllRequiredTags(String) //requiredTags
elements .build();- Returns:
- A new CoffeePickSearch builder
-