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 classCoffeePickSearch.BuilderBuilds instances of typeCoffeePickSearch. -
Method Summary
Modifier and Type Method Description java.util.Optional<java.lang.String>architecture()java.util.Optional<RuntimeHash>archiveHash()java.util.OptionalLongarchiveSize()java.util.Optional<java.net.URI>archiveURI()static CoffeePickSearch.Builderbuilder()Creates a builder forCoffeePickSearch.java.util.Optional<RuntimeConfiguration>configuration()static CoffeePickSearchcopyOf(CoffeePickSearchType instance)Creates an immutable copy of aCoffeePickSearchTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofCoffeePickSearchthat have equal attribute values.inthashCode()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.StringtoString()Prints the immutable valueCoffeePickSearchwith attribute values.java.util.Optional<RuntimeVersionRange>versionRange()java.util.Optional<java.lang.String>vm()CoffeePickSearchwithArchitecture(java.lang.String value)Copy the current immutable object by setting a present value for the optionalarchitectureattribute.CoffeePickSearchwithArchitecture(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thearchitectureattribute.CoffeePickSearchwithArchiveHash(RuntimeHash value)Copy the current immutable object by setting a present value for the optionalarchiveHashattribute.CoffeePickSearchwithArchiveHash(java.util.Optional<? extends RuntimeHash> optional)Copy the current immutable object by setting an optional value for thearchiveHashattribute.CoffeePickSearchwithArchiveSize(long value)Copy the current immutable object by setting a present value for the optionalarchiveSizeattribute.CoffeePickSearchwithArchiveSize(java.util.OptionalLong optional)Copy the current immutable object by setting an optional value for thearchiveSizeattribute.CoffeePickSearchwithArchiveURI(java.net.URI value)Copy the current immutable object by setting a present value for the optionalarchiveURIattribute.CoffeePickSearchwithArchiveURI(java.util.Optional<? extends java.net.URI> optional)Copy the current immutable object by setting an optional value for thearchiveURIattribute.CoffeePickSearchwithConfiguration(RuntimeConfiguration value)Copy the current immutable object by setting a present value for the optionalconfigurationattribute.CoffeePickSearchwithConfiguration(java.util.Optional<? extends RuntimeConfiguration> optional)Copy the current immutable object by setting an optional value for theconfigurationattribute.CoffeePickSearchwithId(java.lang.String value)Copy the current immutable object by setting a present value for the optionalidattribute.CoffeePickSearchwithId(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for theidattribute.CoffeePickSearchwithPlatform(java.lang.String value)Copy the current immutable object by setting a present value for the optionalplatformattribute.CoffeePickSearchwithPlatform(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for theplatformattribute.CoffeePickSearchwithRepository(java.lang.String value)Copy the current immutable object by setting a present value for the optionalrepositoryattribute.CoffeePickSearchwithRepository(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for therepositoryattribute.CoffeePickSearchwithRequiredTags(java.lang.Iterable<java.lang.String> elements)Copy the current immutable object with elements that replace the content ofrequiredTags.CoffeePickSearchwithRequiredTags(java.lang.String... elements)Copy the current immutable object with elements that replace the content ofrequiredTags.CoffeePickSearchwithVersionRange(RuntimeVersionRange value)Copy the current immutable object by setting a present value for the optionalversionRangeattribute.CoffeePickSearchwithVersionRange(java.util.Optional<? extends RuntimeVersionRange> optional)Copy the current immutable object by setting an optional value for theversionRangeattribute.CoffeePickSearchwithVm(java.lang.String value)Copy the current immutable object by setting a present value for the optionalvmattribute.CoffeePickSearchwithVm(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thevmattribute.
-
Method Details
-
repository
public java.util.Optional<java.lang.String> repository()- Specified by:
repositoryin interfaceCoffeePickSearchType- Returns:
- The repository URI
-
versionRange
- Specified by:
versionRangein interfaceCoffeePickSearchType- Returns:
- The range of acceptable runtime versions
-
platform
public java.util.Optional<java.lang.String> platform()- Specified by:
platformin interfaceCoffeePickSearchType- Returns:
- The name of the platform upon which this runtime will run
-
architecture
public java.util.Optional<java.lang.String> architecture()- Specified by:
architecturein interfaceCoffeePickSearchType- Returns:
- The name of the architecture upon which this runtime will run
-
vm
public java.util.Optional<java.lang.String> vm()- Specified by:
vmin interfaceCoffeePickSearchType- Returns:
- The name of the VM used for this runtime
-
configuration
- Specified by:
configurationin interfaceCoffeePickSearchType- Returns:
- The configuration of the runtime
-
archiveURI
public java.util.Optional<java.net.URI> archiveURI()- Specified by:
archiveURIin interfaceCoffeePickSearchType- Returns:
- A URI that can be used to fetch an archive of the runtime
-
archiveSize
public java.util.OptionalLong archiveSize()- Specified by:
archiveSizein interfaceCoffeePickSearchType- Returns:
- The size in octets of the archive
-
archiveHash
- Specified by:
archiveHashin interfaceCoffeePickSearchType- Returns:
- The hash of the runtime
-
id
public java.util.Optional<java.lang.String> id()- Specified by:
idin interfaceCoffeePickSearchType- Returns:
- The unique identifier of the runtime
-
requiredTags
public java.util.Set<java.lang.String> requiredTags()- Specified by:
requiredTagsin 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 optionalrepositoryattribute.- Parameters:
value- The value for repository- Returns:
- A modified copy of
thisobject
-
withRepository
Copy the current immutable object by setting an optional value for therepositoryattribute. 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
thisobject
-
withVersionRange
Copy the current immutable object by setting a present value for the optionalversionRangeattribute.- Parameters:
value- The value for versionRange- Returns:
- A modified copy of
thisobject
-
withVersionRange
public final CoffeePickSearch withVersionRange(java.util.Optional<? extends RuntimeVersionRange> optional)Copy the current immutable object by setting an optional value for theversionRangeattribute. 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
thisobject
-
withPlatform
Copy the current immutable object by setting a present value for the optionalplatformattribute.- Parameters:
value- The value for platform- Returns:
- A modified copy of
thisobject
-
withPlatform
Copy the current immutable object by setting an optional value for theplatformattribute. 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
thisobject
-
withArchitecture
Copy the current immutable object by setting a present value for the optionalarchitectureattribute.- Parameters:
value- The value for architecture- Returns:
- A modified copy of
thisobject
-
withArchitecture
Copy the current immutable object by setting an optional value for thearchitectureattribute. 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
thisobject
-
withVm
Copy the current immutable object by setting a present value for the optionalvmattribute.- Parameters:
value- The value for vm- Returns:
- A modified copy of
thisobject
-
withVm
Copy the current immutable object by setting an optional value for thevmattribute. 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
thisobject
-
withConfiguration
Copy the current immutable object by setting a present value for the optionalconfigurationattribute.- Parameters:
value- The value for configuration- Returns:
- A modified copy of
thisobject
-
withConfiguration
public final CoffeePickSearch withConfiguration(java.util.Optional<? extends RuntimeConfiguration> optional)Copy the current immutable object by setting an optional value for theconfigurationattribute. 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
thisobject
-
withArchiveURI
Copy the current immutable object by setting a present value for the optionalarchiveURIattribute.- Parameters:
value- The value for archiveURI- Returns:
- A modified copy of
thisobject
-
withArchiveURI
Copy the current immutable object by setting an optional value for thearchiveURIattribute. 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
thisobject
-
withArchiveSize
Copy the current immutable object by setting a present value for the optionalarchiveSizeattribute.- Parameters:
value- The value for archiveSize- Returns:
- A modified copy of
thisobject
-
withArchiveSize
Copy the current immutable object by setting an optional value for thearchiveSizeattribute. 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
thisobject
-
withArchiveHash
Copy the current immutable object by setting a present value for the optionalarchiveHashattribute.- Parameters:
value- The value for archiveHash- Returns:
- A modified copy of
thisobject
-
withArchiveHash
Copy the current immutable object by setting an optional value for thearchiveHashattribute. 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
thisobject
-
withId
Copy the current immutable object by setting a present value for the optionalidattribute.- Parameters:
value- The value for id- Returns:
- A modified copy of
thisobject
-
withId
Copy the current immutable object by setting an optional value for theidattribute. 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
thisobject
-
withRequiredTags
Copy the current immutable object with elements that replace the content ofrequiredTags.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
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
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofCoffeePickSearchthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:repository,versionRange,platform,architecture,vm,configuration,archiveURI,archiveSize,archiveHash,id,requiredTags.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueCoffeePickSearchwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
Creates an immutable copy of aCoffeePickSearchTypevalue. 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) // optionalrepository.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) //requiredTagselements .build();- Returns:
- A new CoffeePickSearch builder
-