Class 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().

  • Method Details

    • id

      public String id()
      Specified by:
      id in class BasePolicyResponse
      Returns:
      The value of the id attribute
    • name

      public String name()
      Specified by:
      name in class BasePolicyResponse
      Returns:
      The value of the name attribute
    • datacenters

      public Optional<List<String>> datacenters()
      Specified by:
      datacenters in class BasePolicyResponse
      Returns:
      The value of the datacenters attribute
    • hash

      public String hash()
      Specified by:
      hash in class BasePolicyResponse
      Returns:
      The value of the hash attribute
    • createIndex

      public BigInteger createIndex()
      Specified by:
      createIndex in class BasePolicyResponse
      Returns:
      The value of the createIndex attribute
    • modifyIndex

      public BigInteger modifyIndex()
      Specified by:
      modifyIndex in class BasePolicyResponse
      Returns:
      The value of the modifyIndex attribute
    • withId

      public final ImmutablePolicyResponse withId(String value)
      Copy the current immutable object by setting a value for the id attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for id
      Returns:
      A modified copy of the this object
    • withName

      public final ImmutablePolicyResponse withName(String value)
      Copy the current immutable object by setting a value for the name attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for name
      Returns:
      A modified copy of the this object
    • withDatacenters

      public final ImmutablePolicyResponse withDatacenters(List<String> value)
      Copy the current immutable object by setting a present value for the optional datacenters attribute.
      Parameters:
      value - The value for datacenters
      Returns:
      A modified copy of this object
    • withDatacenters

      public final ImmutablePolicyResponse withDatacenters(Optional<? extends List<String>> optional)
      Copy the current immutable object by setting an optional value for the datacenters attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for datacenters
      Returns:
      A modified copy of this object
    • withHash

      public final ImmutablePolicyResponse withHash(String value)
      Copy the current immutable object by setting a value for the hash attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for hash
      Returns:
      A modified copy of the this object
    • withCreateIndex

      public final ImmutablePolicyResponse withCreateIndex(BigInteger value)
      Copy the current immutable object by setting a value for the createIndex attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for createIndex
      Returns:
      A modified copy of the this object
    • withModifyIndex

      public final ImmutablePolicyResponse withModifyIndex(BigInteger value)
      Copy the current immutable object by setting a value for the modifyIndex attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for modifyIndex
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutablePolicyResponse 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, datacenters, hash, createIndex, modifyIndex.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutablePolicyResponse copyOf(PolicyResponse instance)
      Creates an immutable copy of a PolicyResponse 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 PolicyResponse instance
    • builder

      public static ImmutablePolicyResponse.Builder builder()
      Creates a builder for ImmutablePolicyResponse.
       ImmutablePolicyResponse.builder()
          .id(String) // required id
          .name(String) // required name
          .datacenters(List&lt;String&gt;) // optional datacenters
          .hash(String) // required hash
          .createIndex(java.math.BigInteger) // required createIndex
          .modifyIndex(java.math.BigInteger) // required modifyIndex
          .build();
       
      Returns:
      A new ImmutablePolicyResponse builder