Package com.io7m.coffeepick.api
Class CoffeePickSearch.Builder
java.lang.Object
com.io7m.coffeepick.api.CoffeePickSearch.Builder
- Enclosing class:
- CoffeePickSearch
public static final class CoffeePickSearch.Builder
extends java.lang.Object
Builds instances of type
CoffeePickSearch
.
Initialize attributes and then invoke the build()
method to create an
immutable instance.
Builder
is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and Type Method Description CoffeePickSearch.Builder
addAllRequiredTags(java.lang.Iterable<java.lang.String> elements)
Adds elements torequiredTags
set.CoffeePickSearch.Builder
addRequiredTags(java.lang.String element)
Adds one element torequiredTags
set.CoffeePickSearch.Builder
addRequiredTags(java.lang.String... elements)
Adds elements torequiredTags
set.CoffeePickSearch
build()
Builds a newCoffeePickSearch
.CoffeePickSearch.Builder
from(CoffeePickSearchType instance)
Fill a builder with attribute values from the providedCoffeePickSearchType
instance.CoffeePickSearch.Builder
setArchitecture(java.lang.String architecture)
Initializes the optional valuearchitecture
to architecture.CoffeePickSearch.Builder
setArchitecture(java.util.Optional<java.lang.String> architecture)
Initializes the optional valuearchitecture
to architecture.CoffeePickSearch.Builder
setArchiveHash(RuntimeHash archiveHash)
Initializes the optional valuearchiveHash
to archiveHash.CoffeePickSearch.Builder
setArchiveHash(java.util.Optional<? extends RuntimeHash> archiveHash)
Initializes the optional valuearchiveHash
to archiveHash.CoffeePickSearch.Builder
setArchiveSize(long archiveSize)
Initializes the optional valuearchiveSize
to archiveSize.CoffeePickSearch.Builder
setArchiveSize(java.util.OptionalLong archiveSize)
Initializes the optional valuearchiveSize
to archiveSize.CoffeePickSearch.Builder
setArchiveURI(java.net.URI archiveURI)
Initializes the optional valuearchiveURI
to archiveURI.CoffeePickSearch.Builder
setArchiveURI(java.util.Optional<? extends java.net.URI> archiveURI)
Initializes the optional valuearchiveURI
to archiveURI.CoffeePickSearch.Builder
setConfiguration(RuntimeConfiguration configuration)
Initializes the optional valueconfiguration
to configuration.CoffeePickSearch.Builder
setConfiguration(java.util.Optional<? extends RuntimeConfiguration> configuration)
Initializes the optional valueconfiguration
to configuration.CoffeePickSearch.Builder
setId(java.lang.String id)
Initializes the optional valueid
to id.CoffeePickSearch.Builder
setId(java.util.Optional<java.lang.String> id)
Initializes the optional valueid
to id.CoffeePickSearch.Builder
setPlatform(java.lang.String platform)
Initializes the optional valueplatform
to platform.CoffeePickSearch.Builder
setPlatform(java.util.Optional<java.lang.String> platform)
Initializes the optional valueplatform
to platform.CoffeePickSearch.Builder
setRepository(java.lang.String repository)
Initializes the optional valuerepository
to repository.CoffeePickSearch.Builder
setRepository(java.util.Optional<java.lang.String> repository)
Initializes the optional valuerepository
to repository.CoffeePickSearch.Builder
setRequiredTags(java.lang.Iterable<java.lang.String> elements)
Sets or replaces all elements forrequiredTags
set.CoffeePickSearch.Builder
setVersionRange(RuntimeVersionRange versionRange)
Initializes the optional valueversionRange
to versionRange.CoffeePickSearch.Builder
setVersionRange(java.util.Optional<? extends RuntimeVersionRange> versionRange)
Initializes the optional valueversionRange
to versionRange.CoffeePickSearch.Builder
setVm(java.lang.String vm)
Initializes the optional valuevm
to vm.CoffeePickSearch.Builder
setVm(java.util.Optional<java.lang.String> vm)
Initializes the optional valuevm
to vm.
-
Method Details
-
from
Fill a builder with attribute values from the providedCoffeePickSearchType
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
setRepository
Initializes the optional valuerepository
to repository.- Parameters:
repository
- The value for repository- Returns:
this
builder for chained invocation
-
setRepository
public final CoffeePickSearch.Builder setRepository(java.util.Optional<java.lang.String> repository)Initializes the optional valuerepository
to repository.- Parameters:
repository
- The value for repository- Returns:
this
builder for use in a chained invocation
-
setVersionRange
Initializes the optional valueversionRange
to versionRange.- Parameters:
versionRange
- The value for versionRange- Returns:
this
builder for chained invocation
-
setVersionRange
public final CoffeePickSearch.Builder setVersionRange(java.util.Optional<? extends RuntimeVersionRange> versionRange)Initializes the optional valueversionRange
to versionRange.- Parameters:
versionRange
- The value for versionRange- Returns:
this
builder for use in a chained invocation
-
setPlatform
Initializes the optional valueplatform
to platform.- Parameters:
platform
- The value for platform- Returns:
this
builder for chained invocation
-
setPlatform
Initializes the optional valueplatform
to platform.- Parameters:
platform
- The value for platform- Returns:
this
builder for use in a chained invocation
-
setArchitecture
Initializes the optional valuearchitecture
to architecture.- Parameters:
architecture
- The value for architecture- Returns:
this
builder for chained invocation
-
setArchitecture
public final CoffeePickSearch.Builder setArchitecture(java.util.Optional<java.lang.String> architecture)Initializes the optional valuearchitecture
to architecture.- Parameters:
architecture
- The value for architecture- Returns:
this
builder for use in a chained invocation
-
setVm
Initializes the optional valuevm
to vm.- Parameters:
vm
- The value for vm- Returns:
this
builder for chained invocation
-
setVm
Initializes the optional valuevm
to vm.- Parameters:
vm
- The value for vm- Returns:
this
builder for use in a chained invocation
-
setConfiguration
Initializes the optional valueconfiguration
to configuration.- Parameters:
configuration
- The value for configuration- Returns:
this
builder for chained invocation
-
setConfiguration
public final CoffeePickSearch.Builder setConfiguration(java.util.Optional<? extends RuntimeConfiguration> configuration)Initializes the optional valueconfiguration
to configuration.- Parameters:
configuration
- The value for configuration- Returns:
this
builder for use in a chained invocation
-
setArchiveURI
Initializes the optional valuearchiveURI
to archiveURI.- Parameters:
archiveURI
- The value for archiveURI- Returns:
this
builder for chained invocation
-
setArchiveURI
public final CoffeePickSearch.Builder setArchiveURI(java.util.Optional<? extends java.net.URI> archiveURI)Initializes the optional valuearchiveURI
to archiveURI.- Parameters:
archiveURI
- The value for archiveURI- Returns:
this
builder for use in a chained invocation
-
setArchiveSize
Initializes the optional valuearchiveSize
to archiveSize.- Parameters:
archiveSize
- The value for archiveSize- Returns:
this
builder for chained invocation
-
setArchiveSize
Initializes the optional valuearchiveSize
to archiveSize.- Parameters:
archiveSize
- The value for archiveSize- Returns:
this
builder for use in a chained invocation
-
setArchiveHash
Initializes the optional valuearchiveHash
to archiveHash.- Parameters:
archiveHash
- The value for archiveHash- Returns:
this
builder for chained invocation
-
setArchiveHash
public final CoffeePickSearch.Builder setArchiveHash(java.util.Optional<? extends RuntimeHash> archiveHash)Initializes the optional valuearchiveHash
to archiveHash.- Parameters:
archiveHash
- The value for archiveHash- Returns:
this
builder for use in a chained invocation
-
setId
Initializes the optional valueid
to id.- Parameters:
id
- The value for id- Returns:
this
builder for chained invocation
-
setId
Initializes the optional valueid
to id.- Parameters:
id
- The value for id- Returns:
this
builder for use in a chained invocation
-
addRequiredTags
Adds one element torequiredTags
set.- Parameters:
element
- A requiredTags element- Returns:
this
builder for use in a chained invocation
-
addRequiredTags
Adds elements torequiredTags
set.- Parameters:
elements
- An array of requiredTags elements- Returns:
this
builder for use in a chained invocation
-
setRequiredTags
public final CoffeePickSearch.Builder setRequiredTags(java.lang.Iterable<java.lang.String> elements)Sets or replaces all elements forrequiredTags
set.- Parameters:
elements
- An iterable of requiredTags elements- Returns:
this
builder for use in a chained invocation
-
addAllRequiredTags
public final CoffeePickSearch.Builder addAllRequiredTags(java.lang.Iterable<java.lang.String> elements)Adds elements torequiredTags
set.- Parameters:
elements
- An iterable of requiredTags elements- Returns:
this
builder for use in a chained invocation
-
build
Builds a newCoffeePickSearch
.- Returns:
- An immutable instance of CoffeePickSearch
- Throws:
java.lang.IllegalStateException
- if any required attributes are missing
-