Package org.kiwiproject.consul.model.acl
Class ImmutablePolicyResponse
java.lang.Object
org.kiwiproject.consul.model.acl.BasePolicyResponse
org.kiwiproject.consul.model.acl.PolicyResponse
org.kiwiproject.consul.model.acl.ImmutablePolicyResponse
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutablePolicyResponse
extends PolicyResponse
Immutable implementation of
PolicyResponse.
Use the builder to create immutable instances:
ImmutablePolicyResponse.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutablePolicyResponse. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutablePolicyResponse.static ImmutablePolicyResponsecopyOf(PolicyResponse instance) Creates an immutable copy of aPolicyResponsevalue.booleanThis instance is equal to all instances ofImmutablePolicyResponsethat have equal attribute values.hash()inthashCode()Computes a hash code from attributes:id,name,datacenters,hash,createIndex,modifyIndex.id()name()toString()Prints the immutable valuePolicyResponsewith attribute values.final ImmutablePolicyResponsewithCreateIndex(BigInteger value) Copy the current immutable object by setting a value for thecreateIndexattribute.final ImmutablePolicyResponsewithDatacenters(List<String> value) Copy the current immutable object by setting a present value for the optionaldatacentersattribute.final ImmutablePolicyResponsewithDatacenters(Optional<? extends List<String>> optional) Copy the current immutable object by setting an optional value for thedatacentersattribute.final ImmutablePolicyResponseCopy the current immutable object by setting a value for thehashattribute.final ImmutablePolicyResponseCopy the current immutable object by setting a value for theidattribute.final ImmutablePolicyResponsewithModifyIndex(BigInteger value) Copy the current immutable object by setting a value for themodifyIndexattribute.final ImmutablePolicyResponseCopy the current immutable object by setting a value for thenameattribute.
-
Method Details
-
id
- Specified by:
idin classBasePolicyResponse- Returns:
- The value of the
idattribute
-
name
- Specified by:
namein classBasePolicyResponse- Returns:
- The value of the
nameattribute
-
datacenters
- Specified by:
datacentersin classBasePolicyResponse- Returns:
- The value of the
datacentersattribute
-
hash
- Specified by:
hashin classBasePolicyResponse- Returns:
- The value of the
hashattribute
-
createIndex
- Specified by:
createIndexin classBasePolicyResponse- Returns:
- The value of the
createIndexattribute
-
modifyIndex
- Specified by:
modifyIndexin classBasePolicyResponse- Returns:
- The value of the
modifyIndexattribute
-
withId
Copy the current immutable object by setting a value for theidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id- Returns:
- A modified copy of the
thisobject
-
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 by setting a present value for the optionaldatacentersattribute.- Parameters:
value- The value for datacenters- Returns:
- A modified copy of
thisobject
-
withDatacenters
Copy the current immutable object by setting an optional value for thedatacentersattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for datacenters- Returns:
- A modified copy of
thisobject
-
withHash
Copy the current immutable object by setting a value for thehashattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for hash- Returns:
- A modified copy of the
thisobject
-
withCreateIndex
Copy the current immutable object by setting a value for thecreateIndexattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for createIndex- Returns:
- A modified copy of the
thisobject
-
withModifyIndex
Copy the current immutable object by setting a value for themodifyIndexattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for modifyIndex- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutablePolicyResponsethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:id,name,datacenters,hash,createIndex,modifyIndex. -
toString
Prints the immutable valuePolicyResponsewith attribute values. -
copyOf
Creates an immutable copy of aPolicyResponsevalue. 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 PolicyResponse instance
-
builder
Creates a builder forImmutablePolicyResponse.ImmutablePolicyResponse.builder() .id(String) // requiredid.name(String) // requiredname.datacenters(List<String>) // optionaldatacenters.hash(String) // requiredhash.createIndex(java.math.BigInteger) // requiredcreateIndex.modifyIndex(java.math.BigInteger) // requiredmodifyIndex.build();- Returns:
- A new ImmutablePolicyResponse builder
-