Package org.kiwiproject.consul.model.acl
Class ImmutableServiceIdentity
java.lang.Object
org.kiwiproject.consul.model.acl.Token.ServiceIdentity
org.kiwiproject.consul.model.acl.ImmutableServiceIdentity
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableServiceIdentity
extends Token.ServiceIdentity
Immutable implementation of
Token.ServiceIdentity.
Use the builder to create immutable instances:
ImmutableServiceIdentity.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableServiceIdentity. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableServiceIdentity.static ImmutableServiceIdentitycopyOf(Token.ServiceIdentity instance) Creates an immutable copy of aToken.ServiceIdentityvalue.com.google.common.collect.ImmutableList<String>booleanThis instance is equal to all instances ofImmutableServiceIdentitythat have equal attribute values.inthashCode()Computes a hash code from attributes:name,datacenters.name()toString()Prints the immutable valueServiceIdentitywith attribute values.final ImmutableServiceIdentitywithDatacenters(Iterable<String> elements) Copy the current immutable object with elements that replace the content ofdatacenters.final ImmutableServiceIdentitywithDatacenters(String... elements) Copy the current immutable object with elements that replace the content ofdatacenters.final ImmutableServiceIdentityCopy the current immutable object by setting a value for thenameattribute.
-
Method Details
-
name
- Specified by:
namein classToken.ServiceIdentity- Returns:
- The value of the
nameattribute
-
datacenters
- Specified by:
datacentersin classToken.ServiceIdentity- Returns:
- The value of the
datacentersattribute
-
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
-
withDatacenters
Copy the current immutable object with elements that replace the content ofdatacenters.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withDatacenters
Copy the current immutable object with elements that replace the content ofdatacenters. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of datacenters elements to set- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofImmutableServiceIdentitythat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:name,datacenters. -
toString
Prints the immutable valueServiceIdentitywith attribute values. -
copyOf
Creates an immutable copy of aToken.ServiceIdentityvalue. 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 ServiceIdentity instance
-
builder
Creates a builder forImmutableServiceIdentity.ImmutableServiceIdentity.builder() .name(String) // requiredname.addDatacenters|addAllDatacenters(String) //datacenterselements .build();- Returns:
- A new ImmutableServiceIdentity builder
-