Class ImmutableCatalogRegistration.Builder
java.lang.Object
org.kiwiproject.consul.model.catalog.ImmutableCatalogRegistration.Builder
- Enclosing class:
- ImmutableCatalogRegistration
Builds instances of type
ImmutableCatalogRegistration
.
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 TypeMethodDescriptionInitializes the value for theaddress
attribute.build()
Builds a newImmutableCatalogRegistration
.Initializes the optional valuecheck
to check.Initializes the optional valuecheck
to check.datacenter
(String datacenter) Initializes the optional valuedatacenter
to datacenter.datacenter
(Optional<String> datacenter) Initializes the optional valuedatacenter
to datacenter.from
(CatalogRegistration instance) Fill a builder with attribute values from the providedCatalogRegistration
instance.Initializes the optional valueid
to id.Initializes the optional valueid
to id.Initializes the value for thenode
attribute.Sets or replaces all mappings from the specified map as entries for thenodeMeta
map.putAllNodeMeta
(Map<String, ? extends String> entries) Put all mappings from the specified map as entries tonodeMeta
map.putNodeMeta
(String key, String value) Put one entry to thenodeMeta
map.putNodeMeta
(Map.Entry<String, ? extends String> entry) Put one entry to thenodeMeta
map.Initializes the optional valueservice
to service.Initializes the optional valueservice
to service.skipNodeUpdate
(boolean skipNodeUpdate) Initializes the optional valueskipNodeUpdate
to skipNodeUpdate.skipNodeUpdate
(Optional<Boolean> skipNodeUpdate) Initializes the optional valueskipNodeUpdate
to skipNodeUpdate.taggedAddresses
(Optional<? extends TaggedAddresses> taggedAddresses) Initializes the optional valuetaggedAddresses
to taggedAddresses.taggedAddresses
(TaggedAddresses taggedAddresses) Initializes the optional valuetaggedAddresses
to taggedAddresses.writeRequest
(Optional<? extends WriteRequest> writeRequest) Initializes the optional valuewriteRequest
to writeRequest.writeRequest
(WriteRequest writeRequest) Initializes the optional valuewriteRequest
to writeRequest.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder from(CatalogRegistration instance) Fill a builder with attribute values from the providedCatalogRegistration
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
-
id
Initializes the optional valueid
to id.- Parameters:
id
- The value for id- Returns:
this
builder for chained invocation
-
id
Initializes the optional valueid
to id.- Parameters:
id
- The value for id- Returns:
this
builder for use in a chained invocation
-
datacenter
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder datacenter(String datacenter) Initializes the optional valuedatacenter
to datacenter.- Parameters:
datacenter
- The value for datacenter- Returns:
this
builder for chained invocation
-
datacenter
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder datacenter(Optional<String> datacenter) Initializes the optional valuedatacenter
to datacenter.- Parameters:
datacenter
- The value for datacenter- Returns:
this
builder for use in a chained invocation
-
node
Initializes the value for thenode
attribute.- Parameters:
node
- The value for node- Returns:
this
builder for use in a chained invocation
-
address
Initializes the value for theaddress
attribute.- Parameters:
address
- The value for address- Returns:
this
builder for use in a chained invocation
-
putNodeMeta
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder putNodeMeta(String key, String value) Put one entry to thenodeMeta
map.- Parameters:
key
- The key in the nodeMeta mapvalue
- The associated value in the nodeMeta map- Returns:
this
builder for use in a chained invocation
-
putNodeMeta
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder putNodeMeta(Map.Entry<String, ? extends String> entry) Put one entry to thenodeMeta
map. Nulls are not permitted- Parameters:
entry
- The key and value entry- Returns:
this
builder for use in a chained invocation
-
nodeMeta
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder nodeMeta(Map<String, ? extends String> entries) Sets or replaces all mappings from the specified map as entries for thenodeMeta
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the nodeMeta map- Returns:
this
builder for use in a chained invocation
-
putAllNodeMeta
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder putAllNodeMeta(Map<String, ? extends String> entries) Put all mappings from the specified map as entries tonodeMeta
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the nodeMeta map- Returns:
this
builder for use in a chained invocation
-
taggedAddresses
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder taggedAddresses(TaggedAddresses taggedAddresses) Initializes the optional valuetaggedAddresses
to taggedAddresses.- Parameters:
taggedAddresses
- The value for taggedAddresses- Returns:
this
builder for chained invocation
-
taggedAddresses
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder taggedAddresses(Optional<? extends TaggedAddresses> taggedAddresses) Initializes the optional valuetaggedAddresses
to taggedAddresses.- Parameters:
taggedAddresses
- The value for taggedAddresses- Returns:
this
builder for use in a chained invocation
-
service
Initializes the optional valueservice
to service.- Parameters:
service
- The value for service- Returns:
this
builder for chained invocation
-
service
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder service(Optional<? extends Service> service) Initializes the optional valueservice
to service.- Parameters:
service
- The value for service- Returns:
this
builder for use in a chained invocation
-
check
Initializes the optional valuecheck
to check.- Parameters:
check
- The value for check- Returns:
this
builder for chained invocation
-
check
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder check(Optional<? extends Check> check) Initializes the optional valuecheck
to check.- Parameters:
check
- The value for check- Returns:
this
builder for use in a chained invocation
-
writeRequest
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder writeRequest(WriteRequest writeRequest) Initializes the optional valuewriteRequest
to writeRequest.- Parameters:
writeRequest
- The value for writeRequest- Returns:
this
builder for chained invocation
-
writeRequest
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder writeRequest(Optional<? extends WriteRequest> writeRequest) Initializes the optional valuewriteRequest
to writeRequest.- Parameters:
writeRequest
- The value for writeRequest- Returns:
this
builder for use in a chained invocation
-
skipNodeUpdate
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder skipNodeUpdate(boolean skipNodeUpdate) Initializes the optional valueskipNodeUpdate
to skipNodeUpdate.- Parameters:
skipNodeUpdate
- The value for skipNodeUpdate- Returns:
this
builder for chained invocation
-
skipNodeUpdate
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder skipNodeUpdate(Optional<Boolean> skipNodeUpdate) Initializes the optional valueskipNodeUpdate
to skipNodeUpdate.- Parameters:
skipNodeUpdate
- The value for skipNodeUpdate- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableCatalogRegistration
.- Returns:
- An immutable instance of CatalogRegistration
- Throws:
IllegalStateException
- if any required attributes are missing
-