Package com.orbitz.consul.model.acl
Class ImmutableTokenResponse.Builder
- java.lang.Object
-
- com.orbitz.consul.model.acl.ImmutableTokenResponse.Builder
-
- Enclosing class:
- ImmutableTokenResponse
@NotThreadSafe public static final class ImmutableTokenResponse.Builder extends java.lang.ObjectBuilds instances of typeImmutableTokenResponse. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis 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 Type Method Description ImmutableTokenResponse.BuilderaccessorId(java.lang.String accessorId)Initializes the value for theaccessorIdattribute.ImmutableTokenResponse.BuilderaddAllPolicies(java.lang.Iterable<? extends Token.PolicyLink> elements)Adds elements topolicieslist.ImmutableTokenResponse.BuilderaddPolicies(Token.PolicyLink element)Adds one element topolicieslist.ImmutableTokenResponse.BuilderaddPolicies(Token.PolicyLink... elements)Adds elements topolicieslist.ImmutableTokenResponsebuild()Builds a newImmutableTokenResponse.ImmutableTokenResponse.BuildercreateIndex(java.math.BigInteger createIndex)Initializes the value for thecreateIndexattribute.ImmutableTokenResponse.BuildercreateTime(java.util.Date createTime)Initializes the value for thecreateTimeattribute.ImmutableTokenResponse.Builderdescription(java.lang.String description)Initializes the value for thedescriptionattribute.ImmutableTokenResponse.Builderfrom(BaseTokenResponse instance)Fill a builder with attribute values from the providedcom.orbitz.consul.model.acl.BaseTokenResponseinstance.ImmutableTokenResponse.Builderfrom(TokenResponse instance)Fill a builder with attribute values from the providedcom.orbitz.consul.model.acl.TokenResponseinstance.ImmutableTokenResponse.Builderhash(java.lang.String hash)Initializes the value for thehashattribute.ImmutableTokenResponse.Builderlocal(boolean local)Initializes the value for thelocalattribute.ImmutableTokenResponse.BuildermodifyIndex(java.math.BigInteger modifyIndex)Initializes the value for themodifyIndexattribute.ImmutableTokenResponse.Builderpolicies(java.lang.Iterable<? extends Token.PolicyLink> elements)Sets or replaces all elements forpolicieslist.ImmutableTokenResponse.BuildersecretId(java.lang.String secretId)Initializes the value for thesecretIdattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableTokenResponse.Builder from(TokenResponse instance)
Fill a builder with attribute values from the providedcom.orbitz.consul.model.acl.TokenResponseinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableTokenResponse.Builder from(BaseTokenResponse instance)
Fill a builder with attribute values from the providedcom.orbitz.consul.model.acl.BaseTokenResponseinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
accessorId
@CanIgnoreReturnValue public final ImmutableTokenResponse.Builder accessorId(java.lang.String accessorId)
Initializes the value for theaccessorIdattribute.- Parameters:
accessorId- The value for accessorId- Returns:
thisbuilder for use in a chained invocation
-
description
@CanIgnoreReturnValue public final ImmutableTokenResponse.Builder description(java.lang.String description)
Initializes the value for thedescriptionattribute.- Parameters:
description- The value for description- Returns:
thisbuilder for use in a chained invocation
-
addPolicies
@CanIgnoreReturnValue public final ImmutableTokenResponse.Builder addPolicies(Token.PolicyLink element)
Adds one element topolicieslist.- Parameters:
element- A policies element- Returns:
thisbuilder for use in a chained invocation
-
addPolicies
@CanIgnoreReturnValue public final ImmutableTokenResponse.Builder addPolicies(Token.PolicyLink... elements)
Adds elements topolicieslist.- Parameters:
elements- An array of policies elements- Returns:
thisbuilder for use in a chained invocation
-
policies
@CanIgnoreReturnValue public final ImmutableTokenResponse.Builder policies(java.lang.Iterable<? extends Token.PolicyLink> elements)
Sets or replaces all elements forpolicieslist.- Parameters:
elements- An iterable of policies elements- Returns:
thisbuilder for use in a chained invocation
-
addAllPolicies
@CanIgnoreReturnValue public final ImmutableTokenResponse.Builder addAllPolicies(java.lang.Iterable<? extends Token.PolicyLink> elements)
Adds elements topolicieslist.- Parameters:
elements- An iterable of policies elements- Returns:
thisbuilder for use in a chained invocation
-
createIndex
@CanIgnoreReturnValue public final ImmutableTokenResponse.Builder createIndex(java.math.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 ImmutableTokenResponse.Builder modifyIndex(java.math.BigInteger modifyIndex)
Initializes the value for themodifyIndexattribute.- Parameters:
modifyIndex- The value for modifyIndex- Returns:
thisbuilder for use in a chained invocation
-
local
@CanIgnoreReturnValue public final ImmutableTokenResponse.Builder local(boolean local)
Initializes the value for thelocalattribute.- Parameters:
local- The value for local- Returns:
thisbuilder for use in a chained invocation
-
createTime
@CanIgnoreReturnValue public final ImmutableTokenResponse.Builder createTime(java.util.Date createTime)
Initializes the value for thecreateTimeattribute.- Parameters:
createTime- The value for createTime- Returns:
thisbuilder for use in a chained invocation
-
hash
@CanIgnoreReturnValue public final ImmutableTokenResponse.Builder hash(java.lang.String hash)
Initializes the value for thehashattribute.- Parameters:
hash- The value for hash- Returns:
thisbuilder for use in a chained invocation
-
secretId
@CanIgnoreReturnValue public final ImmutableTokenResponse.Builder secretId(java.lang.String secretId)
Initializes the value for thesecretIdattribute.- Parameters:
secretId- The value for secretId- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableTokenResponse build()
Builds a newImmutableTokenResponse.- Returns:
- An immutable instance of TokenResponse
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
-