Class ImmutableValueSetEntry

java.lang.Object
io.dialob.api.proto.ImmutableValueSetEntry
All Implemented Interfaces:
ValueSetEntry, Serializable

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableValueSetEntry extends Object implements ValueSetEntry
Immutable implementation of ValueSetEntry.

Use the builder to create immutable instances: ImmutableValueSetEntry.builder(). Use the static factory method to create immutable instances: ImmutableValueSetEntry.of().

See Also:
  • Method Details

    • getKey

      public String getKey()
      Specified by:
      getKey in interface ValueSetEntry
      Returns:
      The value of the key attribute
    • getValue

      public String getValue()
      Specified by:
      getValue in interface ValueSetEntry
      Returns:
      The value of the value attribute
    • withKey

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

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

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

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

      public static ImmutableValueSetEntry of(String key, String value)
      Construct a new immutable ValueSetEntry instance.
      Parameters:
      key - The value for the key attribute
      value - The value for the value attribute
      Returns:
      An immutable ValueSetEntry instance
    • copyOf

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

      public static ImmutableValueSetEntry.Builder builder()
      Creates a builder for ImmutableValueSetEntry.
       ImmutableValueSetEntry.builder()
          .key(String) // required key
          .value(String | null) // nullable value
          .build();
       
      Returns:
      A new ImmutableValueSetEntry builder