@NotThreadSafe public static final class ImmutableRegistration.Builder extends Object
ImmutableRegistration.
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.
| Modifier and Type | Method and Description |
|---|---|
ImmutableRegistration.Builder |
addAllChecks(Iterable<? extends Registration.RegCheck> elements)
Adds elements to
checks list. |
ImmutableRegistration.Builder |
addAllTags(Iterable<String> elements)
Adds elements to
tags list. |
ImmutableRegistration.Builder |
addChecks(Registration.RegCheck... elements)
Adds elements to
checks list. |
ImmutableRegistration.Builder |
addChecks(Registration.RegCheck element)
Adds one element to
checks list. |
ImmutableRegistration.Builder |
address(Optional<String> address)
Initializes the optional value
address to address. |
ImmutableRegistration.Builder |
address(String address)
Initializes the optional value
address to address. |
ImmutableRegistration.Builder |
addTags(String... elements)
Adds elements to
tags list. |
ImmutableRegistration.Builder |
addTags(String element)
Adds one element to
tags list. |
ImmutableRegistration |
build()
Builds a new
ImmutableRegistration. |
ImmutableRegistration.Builder |
check(Optional<? extends Registration.RegCheck> check)
Initializes the optional value
check to check. |
ImmutableRegistration.Builder |
check(Registration.RegCheck check)
Initializes the optional value
check to check. |
ImmutableRegistration.Builder |
checks(Iterable<? extends Registration.RegCheck> elements)
Sets or replaces all elements for
checks list. |
ImmutableRegistration.Builder |
enableTagOverride(boolean enableTagOverride)
Initializes the optional value
enableTagOverride to enableTagOverride. |
ImmutableRegistration.Builder |
enableTagOverride(Optional<Boolean> enableTagOverride)
Initializes the optional value
enableTagOverride to enableTagOverride. |
ImmutableRegistration.Builder |
from(Registration instance)
Fill a builder with attribute values from the provided
Registration instance. |
ImmutableRegistration.Builder |
id(String id)
Initializes the value for the
id attribute. |
ImmutableRegistration.Builder |
meta(Map<String,? extends String> entries)
Sets or replaces all mappings from the specified map as entries for the
meta map. |
ImmutableRegistration.Builder |
name(String name)
Initializes the value for the
name attribute. |
ImmutableRegistration.Builder |
port(int port)
Initializes the optional value
port to port. |
ImmutableRegistration.Builder |
port(Optional<Integer> port)
Initializes the optional value
port to port. |
ImmutableRegistration.Builder |
putAllMeta(Map<String,? extends String> entries)
Put all mappings from the specified map as entries to
meta map. |
ImmutableRegistration.Builder |
putMeta(Map.Entry<String,? extends String> entry)
Put one entry to the
meta map. |
ImmutableRegistration.Builder |
putMeta(String key,
String value)
Put one entry to the
meta map. |
ImmutableRegistration.Builder |
tags(Iterable<String> elements)
Sets or replaces all elements for
tags list. |
@CanIgnoreReturnValue public final ImmutableRegistration.Builder from(Registration instance)
Registration 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.instance - The instance from which to copy valuesthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableRegistration.Builder name(String name)
name attribute.name - The value for namethis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableRegistration.Builder id(String id)
id attribute.id - The value for idthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableRegistration.Builder address(String address)
address to address.address - The value for addressthis builder for chained invocation@CanIgnoreReturnValue public final ImmutableRegistration.Builder address(Optional<String> address)
address to address.address - The value for addressthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableRegistration.Builder port(int port)
port to port.port - The value for portthis builder for chained invocation@CanIgnoreReturnValue public final ImmutableRegistration.Builder port(Optional<Integer> port)
port to port.port - The value for portthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableRegistration.Builder check(Registration.RegCheck check)
check to check.check - The value for checkthis builder for chained invocation@CanIgnoreReturnValue public final ImmutableRegistration.Builder check(Optional<? extends Registration.RegCheck> check)
check to check.check - The value for checkthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableRegistration.Builder addChecks(Registration.RegCheck element)
checks list.element - A checks elementthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableRegistration.Builder addChecks(Registration.RegCheck... elements)
checks list.elements - An array of checks elementsthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableRegistration.Builder checks(Iterable<? extends Registration.RegCheck> elements)
checks list.elements - An iterable of checks elementsthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableRegistration.Builder addAllChecks(Iterable<? extends Registration.RegCheck> elements)
checks list.elements - An iterable of checks elementsthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableRegistration.Builder addTags(String element)
tags list.element - A tags elementthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableRegistration.Builder addTags(String... elements)
tags list.elements - An array of tags elementsthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableRegistration.Builder tags(Iterable<String> elements)
tags list.elements - An iterable of tags elementsthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableRegistration.Builder addAllTags(Iterable<String> elements)
tags list.elements - An iterable of tags elementsthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableRegistration.Builder putMeta(String key, String value)
meta map.key - The key in the meta mapvalue - The associated value in the meta mapthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableRegistration.Builder putMeta(Map.Entry<String,? extends String> entry)
meta map. Nulls are not permittedentry - The key and value entrythis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableRegistration.Builder meta(Map<String,? extends String> entries)
meta map. Nulls are not permittedentries - The entries that will be added to the meta mapthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableRegistration.Builder putAllMeta(Map<String,? extends String> entries)
meta map. Nulls are not permittedentries - The entries that will be added to the meta mapthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableRegistration.Builder enableTagOverride(boolean enableTagOverride)
enableTagOverride to enableTagOverride.enableTagOverride - The value for enableTagOverridethis builder for chained invocation@CanIgnoreReturnValue public final ImmutableRegistration.Builder enableTagOverride(Optional<Boolean> enableTagOverride)
enableTagOverride to enableTagOverride.enableTagOverride - The value for enableTagOverridethis builder for use in a chained invocationpublic ImmutableRegistration build()
ImmutableRegistration.IllegalStateException - if any required attributes are missingCopyright © 2019. All rights reserved.