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.Builder
builder()
Creates a builder forImmutableToken
.static ImmutableToken
Creates an immutable copy of aToken
value.boolean
This instance is equal to all instances ofImmutableToken
that have equal attribute values.int
hashCode()
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 valueToken
with attribute values.final ImmutableToken
withDescription
(String value) Copy the current immutable object by setting a present value for the optionaldescription
attribute.final ImmutableToken
withDescription
(Optional<String> optional) Copy the current immutable object by setting an optional value for thedescription
attribute.final ImmutableToken
withExpirationTime
(String value) Copy the current immutable object by setting a present value for the optionalexpirationTime
attribute.final ImmutableToken
withExpirationTime
(Optional<String> optional) Copy the current immutable object by setting an optional value for theexpirationTime
attribute.final ImmutableToken
withExpirationTTL
(String value) Copy the current immutable object by setting a present value for the optionalexpirationTTL
attribute.final ImmutableToken
withExpirationTTL
(Optional<String> optional) Copy the current immutable object by setting an optional value for theexpirationTTL
attribute.final ImmutableToken
Copy the current immutable object by setting a present value for the optionalid
attribute.final ImmutableToken
Copy the current immutable object by setting an optional value for theid
attribute.final ImmutableToken
withLocal
(boolean value) Copy the current immutable object by setting a present value for the optionallocal
attribute.final ImmutableToken
Copy the current immutable object by setting an optional value for thelocal
attribute.final ImmutableToken
withNamespace
(String value) Copy the current immutable object by setting a present value for the optionalnamespace
attribute.final ImmutableToken
withNamespace
(Optional<String> optional) Copy the current immutable object by setting an optional value for thenamespace
attribute.final ImmutableToken
withNodeIdentities
(Iterable<? extends Token.NodeIdentity> elements) Copy the current immutable object with elements that replace the content ofnodeIdentities
.final ImmutableToken
withNodeIdentities
(Token.NodeIdentity... elements) Copy the current immutable object with elements that replace the content ofnodeIdentities
.final ImmutableToken
withPolicies
(Iterable<? extends Token.PolicyLink> elements) Copy the current immutable object with elements that replace the content ofpolicies
.final ImmutableToken
withPolicies
(Token.PolicyLink... elements) Copy the current immutable object with elements that replace the content ofpolicies
.final ImmutableToken
withRoles
(Iterable<? extends Token.RoleLink> elements) Copy the current immutable object with elements that replace the content ofroles
.final ImmutableToken
withRoles
(Token.RoleLink... elements) Copy the current immutable object with elements that replace the content ofroles
.final ImmutableToken
withSecretId
(String value) Copy the current immutable object by setting a present value for the optionalsecretId
attribute.final ImmutableToken
withSecretId
(Optional<String> optional) Copy the current immutable object by setting an optional value for thesecretId
attribute.final ImmutableToken
withServiceIdentities
(Iterable<? extends Token.ServiceIdentity> elements) Copy the current immutable object with elements that replace the content ofserviceIdentities
.final ImmutableToken
withServiceIdentities
(Token.ServiceIdentity... elements) Copy the current immutable object with elements that replace the content ofserviceIdentities
.
-
Method Details
-
id
-
secretId
-
description
- Specified by:
description
in classToken
- Returns:
- The value of the
description
attribute
-
policies
-
roles
-
serviceIdentities
- Specified by:
serviceIdentities
in classToken
- Returns:
- The value of the
serviceIdentities
attribute
-
nodeIdentities
- Specified by:
nodeIdentities
in classToken
- Returns:
- The value of the
nodeIdentities
attribute
-
local
-
expirationTime
- Specified by:
expirationTime
in classToken
- Returns:
- The value of the
expirationTime
attribute
-
expirationTTL
- Specified by:
expirationTTL
in classToken
- Returns:
- The value of the
expirationTTL
attribute
-
namespace
-
withId
Copy the current immutable object by setting a present value for the optionalid
attribute.- Parameters:
value
- The value for id- Returns:
- A modified copy of
this
object
-
withId
Copy the current immutable object by setting an optional value for theid
attribute. 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
this
object
-
withSecretId
Copy the current immutable object by setting a present value for the optionalsecretId
attribute.- Parameters:
value
- The value for secretId- Returns:
- A modified copy of
this
object
-
withSecretId
Copy the current immutable object by setting an optional value for thesecretId
attribute. 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
this
object
-
withDescription
Copy the current immutable object by setting a present value for the optionaldescription
attribute.- Parameters:
value
- The value for description- Returns:
- A modified copy of
this
object
-
withDescription
Copy the current immutable object by setting an optional value for thedescription
attribute. 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
this
object
-
withPolicies
Copy the current immutable object with elements that replace the content ofpolicies
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
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
this
object
-
withRoles
Copy the current immutable object with elements that replace the content ofroles
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
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
this
object
-
withServiceIdentities
Copy the current immutable object with elements that replace the content ofserviceIdentities
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
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
this
object
-
withNodeIdentities
Copy the current immutable object with elements that replace the content ofnodeIdentities
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
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
this
object
-
withLocal
Copy the current immutable object by setting a present value for the optionallocal
attribute.- Parameters:
value
- The value for local- Returns:
- A modified copy of
this
object
-
withLocal
Copy the current immutable object by setting an optional value for thelocal
attribute. 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
this
object
-
withExpirationTime
Copy the current immutable object by setting a present value for the optionalexpirationTime
attribute.- Parameters:
value
- The value for expirationTime- Returns:
- A modified copy of
this
object
-
withExpirationTime
Copy the current immutable object by setting an optional value for theexpirationTime
attribute. 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
this
object
-
withExpirationTTL
Copy the current immutable object by setting a present value for the optionalexpirationTTL
attribute.- Parameters:
value
- The value for expirationTTL- Returns:
- A modified copy of
this
object
-
withExpirationTTL
Copy the current immutable object by setting an optional value for theexpirationTTL
attribute. 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
this
object
-
withNamespace
Copy the current immutable object by setting a present value for the optionalnamespace
attribute.- Parameters:
value
- The value for namespace- Returns:
- A modified copy of
this
object
-
withNamespace
Copy the current immutable object by setting an optional value for thenamespace
attribute. 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
this
object
-
equals
This instance is equal to all instances ofImmutableToken
that 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 valueToken
with attribute values. -
copyOf
Creates an immutable copy of aToken
value. 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) // optional
id
.secretId(String) // optionalsecretId
.description(String) // optionaldescription
.addPolicies|addAllPolicies(org.kiwiproject.consul.model.acl.Token.PolicyLink) //policies
elements .addRoles|addAllRoles(org.kiwiproject.consul.model.acl.Token.RoleLink) //roles
elements .addServiceIdentities|addAllServiceIdentities(org.kiwiproject.consul.model.acl.Token.ServiceIdentity) //serviceIdentities
elements .addNodeIdentities|addAllNodeIdentities(org.kiwiproject.consul.model.acl.Token.NodeIdentity) //nodeIdentities
elements .local(Boolean) // optionallocal
.expirationTime(String) // optionalexpirationTime
.expirationTTL(String) // optionalexpirationTTL
.namespace(String) // optionalnamespace
.build();- Returns:
- A new ImmutableToken builder
-