Package com.orbitz.consul.model.acl
Class ImmutablePolicyLink
- java.lang.Object
-
- com.orbitz.consul.model.acl.Token.PolicyLink
-
- com.orbitz.consul.model.acl.ImmutablePolicyLink
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutablePolicyLink extends Token.PolicyLinkImmutable implementation ofToken.PolicyLink.Use the builder to create immutable instances:
ImmutablePolicyLink.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutablePolicyLink.BuilderBuilds instances of typeImmutablePolicyLink.
-
Method Summary
Modifier and Type Method Description static ImmutablePolicyLink.Builderbuilder()Creates a builder forImmutablePolicyLink.static ImmutablePolicyLinkcopyOf(Token.PolicyLink instance)Creates an immutable copy of aToken.PolicyLinkvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutablePolicyLinkthat have equal attribute values.inthashCode()Computes a hash code from attributes:id,name.java.util.Optional<java.lang.String>id()java.util.Optional<java.lang.String>name()java.lang.StringtoString()Prints the immutable valuePolicyLinkwith attribute values.ImmutablePolicyLinkwithId(java.lang.String value)Copy the current immutable object by setting a present value for the optionalidattribute.ImmutablePolicyLinkwithId(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for theidattribute.ImmutablePolicyLinkwithName(java.lang.String value)Copy the current immutable object by setting a present value for the optionalnameattribute.ImmutablePolicyLinkwithName(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thenameattribute.
-
-
-
Method Detail
-
id
public java.util.Optional<java.lang.String> id()
- Specified by:
idin classToken.PolicyLink- Returns:
- The value of the
idattribute
-
name
public java.util.Optional<java.lang.String> name()
- Specified by:
namein classToken.PolicyLink- Returns:
- The value of the
nameattribute
-
withId
public final ImmutablePolicyLink withId(java.lang.String value)
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
public final ImmutablePolicyLink withId(java.util.Optional<java.lang.String> optional)
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
-
withName
public final ImmutablePolicyLink withName(java.lang.String value)
Copy the current immutable object by setting a present value for the optionalnameattribute.- Parameters:
value- The value for name- Returns:
- A modified copy of
thisobject
-
withName
public final ImmutablePolicyLink withName(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for thenameattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for name- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutablePolicyLinkthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:id,name.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valuePolicyLinkwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutablePolicyLink copyOf(Token.PolicyLink instance)
Creates an immutable copy of aToken.PolicyLinkvalue. 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 PolicyLink instance
-
builder
public static ImmutablePolicyLink.Builder builder()
Creates a builder forImmutablePolicyLink.ImmutablePolicyLink.builder() .id(String) // optionalid.name(String) // optionalname.build();- Returns:
- A new ImmutablePolicyLink builder
-
-