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 todatacenterslist.addDatacenters(String element) Adds one element todatacenterslist.addDatacenters(String... elements) Adds elements todatacenterslist.build()Builds a newImmutableRoleServiceIdentity.datacenters(Iterable<String> elements) Sets or replaces all elements fordatacenterslist.from(Role.RoleServiceIdentity instance) Fill a builder with attribute values from the providedRoleServiceIdentityinstance.Initializes the value for thenameattribute.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableRoleServiceIdentity.Builder from(Role.RoleServiceIdentity instance) Fill a builder with attribute values from the providedRoleServiceIdentityinstance. 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
@CanIgnoreReturnValue public final ImmutableRoleServiceIdentity.Builder addDatacenters(String element) Adds one element todatacenterslist.- Parameters:
element- A datacenters element- Returns:
thisbuilder for use in a chained invocation
-
addDatacenters
@CanIgnoreReturnValue public final ImmutableRoleServiceIdentity.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 ImmutableRoleServiceIdentity.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 ImmutableRoleServiceIdentity.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 newImmutableRoleServiceIdentity.- Returns:
- An immutable instance of RoleServiceIdentity
- Throws:
IllegalStateException- if any required attributes are missing
-