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 theaddressattribute.build()Builds a newImmutableCatalogRegistration.Initializes the optional valuecheckto check.Initializes the optional valuecheckto check.datacenter(String datacenter) Initializes the optional valuedatacenterto datacenter.datacenter(Optional<String> datacenter) Initializes the optional valuedatacenterto datacenter.from(CatalogRegistration instance) Fill a builder with attribute values from the providedCatalogRegistrationinstance.Initializes the optional valueidto id.Initializes the optional valueidto id.Initializes the value for thenodeattribute.Sets or replaces all mappings from the specified map as entries for thenodeMetamap.putAllNodeMeta(Map<String, ? extends String> entries) Put all mappings from the specified map as entries tonodeMetamap.putNodeMeta(String key, String value) Put one entry to thenodeMetamap.putNodeMeta(Map.Entry<String, ? extends String> entry) Put one entry to thenodeMetamap.Initializes the optional valueserviceto service.Initializes the optional valueserviceto service.skipNodeUpdate(boolean skipNodeUpdate) Initializes the optional valueskipNodeUpdateto skipNodeUpdate.skipNodeUpdate(Optional<Boolean> skipNodeUpdate) Initializes the optional valueskipNodeUpdateto skipNodeUpdate.taggedAddresses(Optional<? extends TaggedAddresses> taggedAddresses) Initializes the optional valuetaggedAddressesto taggedAddresses.taggedAddresses(TaggedAddresses taggedAddresses) Initializes the optional valuetaggedAddressesto taggedAddresses.writeRequest(Optional<? extends WriteRequest> writeRequest) Initializes the optional valuewriteRequestto writeRequest.writeRequest(WriteRequest writeRequest) Initializes the optional valuewriteRequestto writeRequest.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder from(CatalogRegistration instance) Fill a builder with attribute values from the providedCatalogRegistrationinstance. 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:
thisbuilder for use in a chained invocation
-
id
Initializes the optional valueidto id.- Parameters:
id- The value for id- Returns:
thisbuilder for chained invocation
-
id
Initializes the optional valueidto id.- Parameters:
id- The value for id- Returns:
thisbuilder for use in a chained invocation
-
datacenter
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder datacenter(String datacenter) Initializes the optional valuedatacenterto datacenter.- Parameters:
datacenter- The value for datacenter- Returns:
thisbuilder for chained invocation
-
datacenter
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder datacenter(Optional<String> datacenter) Initializes the optional valuedatacenterto datacenter.- Parameters:
datacenter- The value for datacenter- Returns:
thisbuilder for use in a chained invocation
-
node
Initializes the value for thenodeattribute.- Parameters:
node- The value for node- Returns:
thisbuilder for use in a chained invocation
-
address
Initializes the value for theaddressattribute.- Parameters:
address- The value for address- Returns:
thisbuilder for use in a chained invocation
-
putNodeMeta
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder putNodeMeta(String key, String value) Put one entry to thenodeMetamap.- Parameters:
key- The key in the nodeMeta mapvalue- The associated value in the nodeMeta map- Returns:
thisbuilder for use in a chained invocation
-
putNodeMeta
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder putNodeMeta(Map.Entry<String, ? extends String> entry) Put one entry to thenodeMetamap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder 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 thenodeMetamap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the nodeMeta map- Returns:
thisbuilder 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 tonodeMetamap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the nodeMeta map- Returns:
thisbuilder for use in a chained invocation
-
taggedAddresses
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder taggedAddresses(TaggedAddresses taggedAddresses) Initializes the optional valuetaggedAddressesto taggedAddresses.- Parameters:
taggedAddresses- The value for taggedAddresses- Returns:
thisbuilder for chained invocation
-
taggedAddresses
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder taggedAddresses(Optional<? extends TaggedAddresses> taggedAddresses) Initializes the optional valuetaggedAddressesto taggedAddresses.- Parameters:
taggedAddresses- The value for taggedAddresses- Returns:
thisbuilder for use in a chained invocation
-
service
Initializes the optional valueserviceto service.- Parameters:
service- The value for service- Returns:
thisbuilder for chained invocation
-
service
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder service(Optional<? extends Service> service) Initializes the optional valueserviceto service.- Parameters:
service- The value for service- Returns:
thisbuilder for use in a chained invocation
-
check
Initializes the optional valuecheckto check.- Parameters:
check- The value for check- Returns:
thisbuilder for chained invocation
-
check
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder check(Optional<? extends Check> check) Initializes the optional valuecheckto check.- Parameters:
check- The value for check- Returns:
thisbuilder for use in a chained invocation
-
writeRequest
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder writeRequest(WriteRequest writeRequest) Initializes the optional valuewriteRequestto writeRequest.- Parameters:
writeRequest- The value for writeRequest- Returns:
thisbuilder for chained invocation
-
writeRequest
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder writeRequest(Optional<? extends WriteRequest> writeRequest) Initializes the optional valuewriteRequestto writeRequest.- Parameters:
writeRequest- The value for writeRequest- Returns:
thisbuilder for use in a chained invocation
-
skipNodeUpdate
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder skipNodeUpdate(boolean skipNodeUpdate) Initializes the optional valueskipNodeUpdateto skipNodeUpdate.- Parameters:
skipNodeUpdate- The value for skipNodeUpdate- Returns:
thisbuilder for chained invocation
-
skipNodeUpdate
@CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder skipNodeUpdate(Optional<Boolean> skipNodeUpdate) Initializes the optional valueskipNodeUpdateto skipNodeUpdate.- Parameters:
skipNodeUpdate- The value for skipNodeUpdate- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableCatalogRegistration.- Returns:
- An immutable instance of CatalogRegistration
- Throws:
IllegalStateException- if any required attributes are missing
-