Package org.kiwiproject.consul.model.acl
Class ImmutablePolicy
java.lang.Object
org.kiwiproject.consul.model.acl.Policy
org.kiwiproject.consul.model.acl.ImmutablePolicy
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutablePolicy
extends Policy
Immutable implementation of
Policy.
Use the builder to create immutable instances:
ImmutablePolicy.builder().
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutablePolicy.Builderbuilder()Creates a builder forImmutablePolicy.static ImmutablePolicyCreates an immutable copy of aPolicyvalue.booleanThis instance is equal to all instances ofImmutablePolicythat have equal attribute values.inthashCode()Computes a hash code from attributes:id,description,name,rules,datacenters.id()name()rules()toString()Prints the immutable valuePolicywith attribute values.final ImmutablePolicywithDatacenters(List<String> value) Copy the current immutable object by setting a present value for the optionaldatacentersattribute.final ImmutablePolicywithDatacenters(Optional<? extends List<String>> optional) Copy the current immutable object by setting an optional value for thedatacentersattribute.final ImmutablePolicywithDescription(String value) Copy the current immutable object by setting a present value for the optionaldescriptionattribute.final ImmutablePolicywithDescription(Optional<String> optional) Copy the current immutable object by setting an optional value for thedescriptionattribute.final ImmutablePolicyCopy the current immutable object by setting a present value for the optionalidattribute.final ImmutablePolicyCopy the current immutable object by setting an optional value for theidattribute.final ImmutablePolicyCopy the current immutable object by setting a value for thenameattribute.final ImmutablePolicyCopy the current immutable object by setting a present value for the optionalrulesattribute.final ImmutablePolicyCopy the current immutable object by setting an optional value for therulesattribute.
-
Method Details
-
id
-
description
- Specified by:
descriptionin classPolicy- Returns:
- The value of the
descriptionattribute
-
name
-
rules
-
datacenters
- Specified by:
datacentersin classPolicy- Returns:
- The value of the
datacentersattribute
-
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
-
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
-
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
-
withRules
Copy the current immutable object by setting a present value for the optionalrulesattribute.- Parameters:
value- The value for rules- Returns:
- A modified copy of
thisobject
-
withRules
Copy the current immutable object by setting an optional value for therulesattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for rules- Returns:
- A modified copy of
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
-
equals
This instance is equal to all instances ofImmutablePolicythat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:id,description,name,rules,datacenters. -
toString
Prints the immutable valuePolicywith attribute values. -
copyOf
Creates an immutable copy of aPolicyvalue. 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 Policy instance
-
builder
Creates a builder forImmutablePolicy.ImmutablePolicy.builder() .id(String) // optionalid.description(String) // optionaldescription.name(String) // requiredname.rules(String) // optionalrules.datacenters(List<String>) // optionaldatacenters.build();- Returns:
- A new ImmutablePolicy builder
-