Package org.kiwiproject.consul.model.acl
Class ImmutableRoleResponse.Builder
java.lang.Object
org.kiwiproject.consul.model.acl.ImmutableRoleResponse.Builder
- Enclosing class:
- ImmutableRoleResponse
Builds instances of type
ImmutableRoleResponse
.
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 TypeMethodDescriptionaddAllNodeIdentities
(Iterable<? extends Role.RoleNodeIdentity> elements) Adds elements tonodeIdentities
list.addAllPolicies
(Iterable<? extends Role.RolePolicyLink> elements) Adds elements topolicies
list.addAllServiceIdentities
(Iterable<? extends Role.RoleServiceIdentity> elements) Adds elements toserviceIdentities
list.addNodeIdentities
(Role.RoleNodeIdentity element) Adds one element tonodeIdentities
list.addNodeIdentities
(Role.RoleNodeIdentity... elements) Adds elements tonodeIdentities
list.addPolicies
(Role.RolePolicyLink element) Adds one element topolicies
list.addPolicies
(Role.RolePolicyLink... elements) Adds elements topolicies
list.Adds one element toserviceIdentities
list.addServiceIdentities
(Role.RoleServiceIdentity... elements) Adds elements toserviceIdentities
list.build()
Builds a newImmutableRoleResponse
.createIndex
(BigInteger createIndex) Initializes the value for thecreateIndex
attribute.description
(String description) Initializes the value for thedescription
attribute.from
(BaseRoleResponse instance) Fill a builder with attribute values from the providedorg.kiwiproject.consul.model.acl.BaseRoleResponse
instance.from
(RoleResponse instance) Fill a builder with attribute values from the providedorg.kiwiproject.consul.model.acl.RoleResponse
instance.Initializes the value for thehash
attribute.Initializes the value for theid
attribute.modifyIndex
(BigInteger modifyIndex) Initializes the value for themodifyIndex
attribute.Initializes the value for thename
attribute.nodeIdentities
(Iterable<? extends Role.RoleNodeIdentity> elements) Sets or replaces all elements fornodeIdentities
list.policies
(Iterable<? extends Role.RolePolicyLink> elements) Sets or replaces all elements forpolicies
list.serviceIdentities
(Iterable<? extends Role.RoleServiceIdentity> elements) Sets or replaces all elements forserviceIdentities
list.
-
Method Details
-
from
Fill a builder with attribute values from the providedorg.kiwiproject.consul.model.acl.BaseRoleResponse
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
Fill a builder with attribute values from the providedorg.kiwiproject.consul.model.acl.RoleResponse
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
id
Initializes the value for theid
attribute.- Parameters:
id
- The value for id- 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
-
description
Initializes the value for thedescription
attribute.- Parameters:
description
- The value for description- Returns:
this
builder for use in a chained invocation
-
addPolicies
@CanIgnoreReturnValue public final ImmutableRoleResponse.Builder addPolicies(Role.RolePolicyLink element) Adds one element topolicies
list.- Parameters:
element
- A policies element- Returns:
this
builder for use in a chained invocation
-
addPolicies
@CanIgnoreReturnValue public final ImmutableRoleResponse.Builder addPolicies(Role.RolePolicyLink... elements) Adds elements topolicies
list.- Parameters:
elements
- An array of policies elements- Returns:
this
builder for use in a chained invocation
-
policies
@CanIgnoreReturnValue public final ImmutableRoleResponse.Builder policies(Iterable<? extends Role.RolePolicyLink> elements) Sets or replaces all elements forpolicies
list.- Parameters:
elements
- An iterable of policies elements- Returns:
this
builder for use in a chained invocation
-
addAllPolicies
@CanIgnoreReturnValue public final ImmutableRoleResponse.Builder addAllPolicies(Iterable<? extends Role.RolePolicyLink> elements) Adds elements topolicies
list.- Parameters:
elements
- An iterable of policies elements- Returns:
this
builder for use in a chained invocation
-
addServiceIdentities
@CanIgnoreReturnValue public final ImmutableRoleResponse.Builder addServiceIdentities(Role.RoleServiceIdentity element) Adds one element toserviceIdentities
list.- Parameters:
element
- A serviceIdentities element- Returns:
this
builder for use in a chained invocation
-
addServiceIdentities
@CanIgnoreReturnValue public final ImmutableRoleResponse.Builder addServiceIdentities(Role.RoleServiceIdentity... elements) Adds elements toserviceIdentities
list.- Parameters:
elements
- An array of serviceIdentities elements- Returns:
this
builder for use in a chained invocation
-
serviceIdentities
@CanIgnoreReturnValue public final ImmutableRoleResponse.Builder serviceIdentities(Iterable<? extends Role.RoleServiceIdentity> elements) Sets or replaces all elements forserviceIdentities
list.- Parameters:
elements
- An iterable of serviceIdentities elements- Returns:
this
builder for use in a chained invocation
-
addAllServiceIdentities
@CanIgnoreReturnValue public final ImmutableRoleResponse.Builder addAllServiceIdentities(Iterable<? extends Role.RoleServiceIdentity> elements) Adds elements toserviceIdentities
list.- Parameters:
elements
- An iterable of serviceIdentities elements- Returns:
this
builder for use in a chained invocation
-
addNodeIdentities
@CanIgnoreReturnValue public final ImmutableRoleResponse.Builder addNodeIdentities(Role.RoleNodeIdentity element) Adds one element tonodeIdentities
list.- Parameters:
element
- A nodeIdentities element- Returns:
this
builder for use in a chained invocation
-
addNodeIdentities
@CanIgnoreReturnValue public final ImmutableRoleResponse.Builder addNodeIdentities(Role.RoleNodeIdentity... elements) Adds elements tonodeIdentities
list.- Parameters:
elements
- An array of nodeIdentities elements- Returns:
this
builder for use in a chained invocation
-
nodeIdentities
@CanIgnoreReturnValue public final ImmutableRoleResponse.Builder nodeIdentities(Iterable<? extends Role.RoleNodeIdentity> elements) Sets or replaces all elements fornodeIdentities
list.- Parameters:
elements
- An iterable of nodeIdentities elements- Returns:
this
builder for use in a chained invocation
-
addAllNodeIdentities
@CanIgnoreReturnValue public final ImmutableRoleResponse.Builder addAllNodeIdentities(Iterable<? extends Role.RoleNodeIdentity> elements) Adds elements tonodeIdentities
list.- Parameters:
elements
- An iterable of nodeIdentities elements- Returns:
this
builder for use in a chained invocation
-
createIndex
@CanIgnoreReturnValue public final ImmutableRoleResponse.Builder createIndex(BigInteger createIndex) Initializes the value for thecreateIndex
attribute.- Parameters:
createIndex
- The value for createIndex- Returns:
this
builder for use in a chained invocation
-
modifyIndex
@CanIgnoreReturnValue public final ImmutableRoleResponse.Builder modifyIndex(BigInteger modifyIndex) Initializes the value for themodifyIndex
attribute.- Parameters:
modifyIndex
- The value for modifyIndex- Returns:
this
builder for use in a chained invocation
-
hash
Initializes the value for thehash
attribute.- Parameters:
hash
- The value for hash- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableRoleResponse
.- Returns:
- An immutable instance of RoleResponse
- Throws:
IllegalStateException
- if any required attributes are missing
-