Class ProfileField

java.lang.Object
com.hubspot.slack.client.models.users.ProfileField
All Implemented Interfaces:
ProfileFieldIF

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

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

  • Method Details

    • getValue

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

      public Optional<String> getAlt()
      Specified by:
      getAlt in interface ProfileFieldIF
      Returns:
      The value of the alt attribute
    • withValue

      public final ProfileField 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
    • withAlt

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

      public final ProfileField withAlt(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the alt 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 alt
      Returns:
      A modified copy or this if not changed
    • equals

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

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

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

      public static ProfileField.Builder builder()
      Creates a builder for ProfileField.
       ProfileField.builder()
          .setValue(String) // required value
          .setAlt(Optional<String>) // optional alt
          .build();
       
      Returns:
      A new ProfileField builder