Class ImmutablePolicyLink

java.lang.Object
org.kiwiproject.consul.model.acl.Token.PolicyLink
org.kiwiproject.consul.model.acl.ImmutablePolicyLink

@Generated("org.immutables.processor.ProxyProcessor") public final class ImmutablePolicyLink extends Token.PolicyLink
Immutable implementation of Token.PolicyLink.

Use the builder to create immutable instances: ImmutablePolicyLink.builder().

  • Method Details

    • id

      public Optional<String> id()
      Specified by:
      id in class Token.PolicyLink
      Returns:
      The value of the id attribute
    • name

      public Optional<String> name()
      Specified by:
      name in class Token.PolicyLink
      Returns:
      The value of the name attribute
    • withId

      public final ImmutablePolicyLink withId(String value)
      Copy the current immutable object by setting a present value for the optional id attribute.
      Parameters:
      value - The value for id
      Returns:
      A modified copy of this object
    • withId

      public final ImmutablePolicyLink withId(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the id attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for id
      Returns:
      A modified copy of this object
    • withName

      public final ImmutablePolicyLink withName(String value)
      Copy the current immutable object by setting a present value for the optional name attribute.
      Parameters:
      value - The value for name
      Returns:
      A modified copy of this object
    • withName

      public final ImmutablePolicyLink withName(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the name attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for name
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutablePolicyLink that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: id, name.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value PolicyLink with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutablePolicyLink copyOf(Token.PolicyLink instance)
      Creates an immutable copy of a Token.PolicyLink value. 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 for ImmutablePolicyLink.
       ImmutablePolicyLink.builder()
          .id(String) // optional id
          .name(String) // optional name
          .build();
       
      Returns:
      A new ImmutablePolicyLink builder