Package org.kiwiproject.consul.model.acl
Class ImmutablePolicyResponse.Builder
java.lang.Object
org.kiwiproject.consul.model.acl.ImmutablePolicyResponse.Builder
- Enclosing class:
- ImmutablePolicyResponse
Builds instances of type
ImmutablePolicyResponse.
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 TypeMethodDescriptionbuild()Builds a newImmutablePolicyResponse.createIndex(BigInteger createIndex) Initializes the value for thecreateIndexattribute.datacenters(List<String> datacenters) Initializes the optional valuedatacentersto datacenters.datacenters(Optional<? extends List<String>> datacenters) Initializes the optional valuedatacentersto datacenters.from(BasePolicyResponse instance) Fill a builder with attribute values from the providedorg.kiwiproject.consul.model.acl.BasePolicyResponseinstance.from(PolicyResponse instance) Fill a builder with attribute values from the providedorg.kiwiproject.consul.model.acl.PolicyResponseinstance.Initializes the value for thehashattribute.Initializes the value for theidattribute.modifyIndex(BigInteger modifyIndex) Initializes the value for themodifyIndexattribute.Initializes the value for thenameattribute.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutablePolicyResponse.Builder from(BasePolicyResponse instance) Fill a builder with attribute values from the providedorg.kiwiproject.consul.model.acl.BasePolicyResponseinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
Fill a builder with attribute values from the providedorg.kiwiproject.consul.model.acl.PolicyResponseinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
id
Initializes the value for theidattribute.- Parameters:
id- The value for id- 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
-
datacenters
@CanIgnoreReturnValue public final ImmutablePolicyResponse.Builder datacenters(List<String> datacenters) Initializes the optional valuedatacentersto datacenters.- Parameters:
datacenters- The value for datacenters- Returns:
thisbuilder for chained invocation
-
datacenters
@CanIgnoreReturnValue public final ImmutablePolicyResponse.Builder datacenters(Optional<? extends List<String>> datacenters) Initializes the optional valuedatacentersto datacenters.- Parameters:
datacenters- The value for datacenters- Returns:
thisbuilder for use in a chained invocation
-
hash
Initializes the value for thehashattribute.- Parameters:
hash- The value for hash- Returns:
thisbuilder for use in a chained invocation
-
createIndex
@CanIgnoreReturnValue public final ImmutablePolicyResponse.Builder createIndex(BigInteger createIndex) Initializes the value for thecreateIndexattribute.- Parameters:
createIndex- The value for createIndex- Returns:
thisbuilder for use in a chained invocation
-
modifyIndex
@CanIgnoreReturnValue public final ImmutablePolicyResponse.Builder modifyIndex(BigInteger modifyIndex) Initializes the value for themodifyIndexattribute.- Parameters:
modifyIndex- The value for modifyIndex- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutablePolicyResponse.- Returns:
- An immutable instance of PolicyResponse
- Throws:
IllegalStateException- if any required attributes are missing
-