Package org.kiwiproject.consul.model.acl
Class ImmutableToken
java.lang.Object
org.kiwiproject.consul.model.acl.Token
org.kiwiproject.consul.model.acl.ImmutableToken
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableToken
extends Token
Immutable implementation of
Token.
Use the builder to create immutable instances:
ImmutableToken.builder().
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.kiwiproject.consul.model.acl.Token
Token.NodeIdentity, Token.PolicyLink, Token.RoleLink, Token.ServiceIdentity -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableToken.Builderbuilder()Creates a builder forImmutableToken.static ImmutableTokenCreates an immutable copy of aTokenvalue.booleanThis instance is equal to all instances ofImmutableTokenthat have equal attribute values.inthashCode()Computes a hash code from attributes:id,secretId,description,policies,roles,serviceIdentities,nodeIdentities,local,expirationTime,expirationTTL,namespace.id()local()com.google.common.collect.ImmutableList<Token.NodeIdentity>com.google.common.collect.ImmutableList<Token.PolicyLink>policies()com.google.common.collect.ImmutableList<Token.RoleLink>roles()secretId()com.google.common.collect.ImmutableList<Token.ServiceIdentity>toString()Prints the immutable valueTokenwith attribute values.final ImmutableTokenwithDescription(String value) Copy the current immutable object by setting a present value for the optionaldescriptionattribute.final ImmutableTokenwithDescription(Optional<String> optional) Copy the current immutable object by setting an optional value for thedescriptionattribute.final ImmutableTokenwithExpirationTime(String value) Copy the current immutable object by setting a present value for the optionalexpirationTimeattribute.final ImmutableTokenwithExpirationTime(Optional<String> optional) Copy the current immutable object by setting an optional value for theexpirationTimeattribute.final ImmutableTokenwithExpirationTTL(String value) Copy the current immutable object by setting a present value for the optionalexpirationTTLattribute.final ImmutableTokenwithExpirationTTL(Optional<String> optional) Copy the current immutable object by setting an optional value for theexpirationTTLattribute.final ImmutableTokenCopy the current immutable object by setting a present value for the optionalidattribute.final ImmutableTokenCopy the current immutable object by setting an optional value for theidattribute.final ImmutableTokenwithLocal(boolean value) Copy the current immutable object by setting a present value for the optionallocalattribute.final ImmutableTokenCopy the current immutable object by setting an optional value for thelocalattribute.final ImmutableTokenwithNamespace(String value) Copy the current immutable object by setting a present value for the optionalnamespaceattribute.final ImmutableTokenwithNamespace(Optional<String> optional) Copy the current immutable object by setting an optional value for thenamespaceattribute.final ImmutableTokenwithNodeIdentities(Iterable<? extends Token.NodeIdentity> elements) Copy the current immutable object with elements that replace the content ofnodeIdentities.final ImmutableTokenwithNodeIdentities(Token.NodeIdentity... elements) Copy the current immutable object with elements that replace the content ofnodeIdentities.final ImmutableTokenwithPolicies(Iterable<? extends Token.PolicyLink> elements) Copy the current immutable object with elements that replace the content ofpolicies.final ImmutableTokenwithPolicies(Token.PolicyLink... elements) Copy the current immutable object with elements that replace the content ofpolicies.final ImmutableTokenwithRoles(Iterable<? extends Token.RoleLink> elements) Copy the current immutable object with elements that replace the content ofroles.final ImmutableTokenwithRoles(Token.RoleLink... elements) Copy the current immutable object with elements that replace the content ofroles.final ImmutableTokenwithSecretId(String value) Copy the current immutable object by setting a present value for the optionalsecretIdattribute.final ImmutableTokenwithSecretId(Optional<String> optional) Copy the current immutable object by setting an optional value for thesecretIdattribute.final ImmutableTokenwithServiceIdentities(Iterable<? extends Token.ServiceIdentity> elements) Copy the current immutable object with elements that replace the content ofserviceIdentities.final ImmutableTokenwithServiceIdentities(Token.ServiceIdentity... elements) Copy the current immutable object with elements that replace the content ofserviceIdentities.
-
Method Details
-
id
-
secretId
-
description
- Specified by:
descriptionin classToken- Returns:
- The value of the
descriptionattribute
-
policies
-
roles
-
serviceIdentities
- Specified by:
serviceIdentitiesin classToken- Returns:
- The value of the
serviceIdentitiesattribute
-
nodeIdentities
- Specified by:
nodeIdentitiesin classToken- Returns:
- The value of the
nodeIdentitiesattribute
-
local
-
expirationTime
- Specified by:
expirationTimein classToken- Returns:
- The value of the
expirationTimeattribute
-
expirationTTL
- Specified by:
expirationTTLin classToken- Returns:
- The value of the
expirationTTLattribute
-
namespace
-
withId
Copy the current immutable object by setting a present value for the optionalidattribute.- Parameters:
value- The value for id- Returns:
- A modified copy of
thisobject
-
withId
Copy the current immutable object by setting an optional value for theidattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for id- Returns:
- A modified copy of
thisobject
-
withSecretId
Copy the current immutable object by setting a present value for the optionalsecretIdattribute.- Parameters:
value- The value for secretId- Returns:
- A modified copy of
thisobject
-
withSecretId
Copy the current immutable object by setting an optional value for thesecretIdattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for secretId- Returns:
- A modified copy of
thisobject
-
withDescription
Copy the current immutable object by setting a present value for the optionaldescriptionattribute.- Parameters:
value- The value for description- Returns:
- A modified copy of
thisobject
-
withDescription
Copy the current immutable object by setting an optional value for thedescriptionattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for description- Returns:
- A modified copy of
thisobject
-
withPolicies
Copy the current immutable object with elements that replace the content ofpolicies.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withPolicies
Copy the current immutable object with elements that replace the content ofpolicies. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of policies elements to set- Returns:
- A modified copy of
thisobject
-
withRoles
Copy the current immutable object with elements that replace the content ofroles.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withRoles
Copy the current immutable object with elements that replace the content ofroles. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of roles elements to set- Returns:
- A modified copy of
thisobject
-
withServiceIdentities
Copy the current immutable object with elements that replace the content ofserviceIdentities.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withServiceIdentities
public final ImmutableToken withServiceIdentities(Iterable<? extends Token.ServiceIdentity> elements) Copy the current immutable object with elements that replace the content ofserviceIdentities. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of serviceIdentities elements to set- Returns:
- A modified copy of
thisobject
-
withNodeIdentities
Copy the current immutable object with elements that replace the content ofnodeIdentities.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withNodeIdentities
Copy the current immutable object with elements that replace the content ofnodeIdentities. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of nodeIdentities elements to set- Returns:
- A modified copy of
thisobject
-
withLocal
Copy the current immutable object by setting a present value for the optionallocalattribute.- Parameters:
value- The value for local- Returns:
- A modified copy of
thisobject
-
withLocal
Copy the current immutable object by setting an optional value for thelocalattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for local- Returns:
- A modified copy of
thisobject
-
withExpirationTime
Copy the current immutable object by setting a present value for the optionalexpirationTimeattribute.- Parameters:
value- The value for expirationTime- Returns:
- A modified copy of
thisobject
-
withExpirationTime
Copy the current immutable object by setting an optional value for theexpirationTimeattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for expirationTime- Returns:
- A modified copy of
thisobject
-
withExpirationTTL
Copy the current immutable object by setting a present value for the optionalexpirationTTLattribute.- Parameters:
value- The value for expirationTTL- Returns:
- A modified copy of
thisobject
-
withExpirationTTL
Copy the current immutable object by setting an optional value for theexpirationTTLattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for expirationTTL- Returns:
- A modified copy of
thisobject
-
withNamespace
Copy the current immutable object by setting a present value for the optionalnamespaceattribute.- Parameters:
value- The value for namespace- Returns:
- A modified copy of
thisobject
-
withNamespace
Copy the current immutable object by setting an optional value for thenamespaceattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for namespace- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofImmutableTokenthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:id,secretId,description,policies,roles,serviceIdentities,nodeIdentities,local,expirationTime,expirationTTL,namespace. -
toString
Prints the immutable valueTokenwith attribute values. -
copyOf
Creates an immutable copy of aTokenvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Token instance
-
builder
Creates a builder forImmutableToken.ImmutableToken.builder() .id(String) // optionalid.secretId(String) // optionalsecretId.description(String) // optionaldescription.addPolicies|addAllPolicies(org.kiwiproject.consul.model.acl.Token.PolicyLink) //policieselements .addRoles|addAllRoles(org.kiwiproject.consul.model.acl.Token.RoleLink) //roleselements .addServiceIdentities|addAllServiceIdentities(org.kiwiproject.consul.model.acl.Token.ServiceIdentity) //serviceIdentitieselements .addNodeIdentities|addAllNodeIdentities(org.kiwiproject.consul.model.acl.Token.NodeIdentity) //nodeIdentitieselements .local(Boolean) // optionallocal.expirationTime(String) // optionalexpirationTime.expirationTTL(String) // optionalexpirationTTL.namespace(String) // optionalnamespace.build();- Returns:
- A new ImmutableToken builder
-