Package org.kiwiproject.consul.model.acl
Class ImmutableServiceIdentity.Builder
java.lang.Object
org.kiwiproject.consul.model.acl.ImmutableServiceIdentity.Builder
- Enclosing class:
- ImmutableServiceIdentity
Builds instances of type
ImmutableServiceIdentity.
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 TypeMethodDescriptionaddAllDatacenters(Iterable<String> elements) Adds elements todatacenterslist.addDatacenters(String element) Adds one element todatacenterslist.addDatacenters(String... elements) Adds elements todatacenterslist.build()Builds a newImmutableServiceIdentity.datacenters(Iterable<String> elements) Sets or replaces all elements fordatacenterslist.from(Token.ServiceIdentity instance) Fill a builder with attribute values from the providedServiceIdentityinstance.Initializes the value for thenameattribute.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableServiceIdentity.Builder from(Token.ServiceIdentity instance) Fill a builder with attribute values from the providedServiceIdentityinstance. 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
-
name
Initializes the value for thenameattribute.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
addDatacenters
Adds one element todatacenterslist.- Parameters:
element- A datacenters element- Returns:
thisbuilder for use in a chained invocation
-
addDatacenters
@CanIgnoreReturnValue public final ImmutableServiceIdentity.Builder addDatacenters(String... elements) Adds elements todatacenterslist.- Parameters:
elements- An array of datacenters elements- Returns:
thisbuilder for use in a chained invocation
-
datacenters
@CanIgnoreReturnValue public final ImmutableServiceIdentity.Builder datacenters(Iterable<String> elements) Sets or replaces all elements fordatacenterslist.- Parameters:
elements- An iterable of datacenters elements- Returns:
thisbuilder for use in a chained invocation
-
addAllDatacenters
@CanIgnoreReturnValue public final ImmutableServiceIdentity.Builder addAllDatacenters(Iterable<String> elements) Adds elements todatacenterslist.- Parameters:
elements- An iterable of datacenters elements- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableServiceIdentity.- Returns:
- An immutable instance of ServiceIdentity
- Throws:
IllegalStateException- if any required attributes are missing
-