Package org.kiwiproject.consul.model.acl
Class ImmutableNodeIdentity
java.lang.Object
org.kiwiproject.consul.model.acl.Token.NodeIdentity
org.kiwiproject.consul.model.acl.ImmutableNodeIdentity
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableNodeIdentity
extends Token.NodeIdentity
Immutable implementation of
Token.NodeIdentity.
Use the builder to create immutable instances:
ImmutableNodeIdentity.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableNodeIdentity. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableNodeIdentity.static ImmutableNodeIdentitycopyOf(Token.NodeIdentity instance) Creates an immutable copy of aToken.NodeIdentityvalue.booleanThis instance is equal to all instances ofImmutableNodeIdentitythat have equal attribute values.inthashCode()Computes a hash code from attributes:name,datacenter.name()toString()Prints the immutable valueNodeIdentitywith attribute values.final ImmutableNodeIdentitywithDatacenter(String value) Copy the current immutable object by setting a value for thedatacenterattribute.final ImmutableNodeIdentityCopy the current immutable object by setting a value for thenameattribute.
-
Method Details
-
name
- Specified by:
namein classToken.NodeIdentity- Returns:
- The value of the
nameattribute
-
datacenter
- Specified by:
datacenterin classToken.NodeIdentity- Returns:
- The value of the
datacenterattribute
-
withName
Copy the current immutable object by setting a value for thenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy of the
thisobject
-
withDatacenter
Copy the current immutable object by setting a value for thedatacenterattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for datacenter- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableNodeIdentitythat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:name,datacenter. -
toString
Prints the immutable valueNodeIdentitywith attribute values. -
copyOf
Creates an immutable copy of aToken.NodeIdentityvalue. 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 NodeIdentity instance
-
builder
Creates a builder forImmutableNodeIdentity.ImmutableNodeIdentity.builder() .name(String) // requiredname.datacenter(String) // requireddatacenter.build();- Returns:
- A new ImmutableNodeIdentity builder
-