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