Class Field

java.lang.Object
com.hubspot.slack.client.models.Field
All Implemented Interfaces:
FieldIF

@Generated(from="FieldIF", generator="Immutables") @ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class Field extends Object implements FieldIF
Immutable implementation of FieldIF.

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

  • Method Details

    • getTitle

      public Optional<String> getTitle()
      Specified by:
      getTitle in interface FieldIF
      Returns:
      The value of the title attribute
    • getValue

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

      public boolean isShort()
      Specified by:
      isShort in interface FieldIF
      Returns:
      The value of the isShort attribute
    • withTitle

      public final Field withTitle(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional title attribute.
      Parameters:
      value - The value for title, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withTitle

      public final Field withTitle(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the title attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for title
      Returns:
      A modified copy or this if not changed
    • withValue

      public final Field 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
      Returns:
      A modified copy or the this object
    • withShort

      public final Field withShort(boolean value)
      Copy the current immutable object by setting a value for the short attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for isShort
      Returns:
      A modified copy or the this object
    • equals

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

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

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

      public static Field.Builder builder()
      Creates a builder for Field.
       Field.builder()
          .setTitle(Optional<String>) // optional title
          .setValue(String) // required value
          .setShort(boolean) // required short
          .build();
       
      Returns:
      A new Field builder