Class Reaction

java.lang.Object
com.hubspot.slack.client.models.Reaction
All Implemented Interfaces:
ReactionIF

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

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

  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface ReactionIF
      Returns:
      The value of the name attribute
    • getCount

      public int getCount()
      Specified by:
      getCount in interface ReactionIF
      Returns:
      The value of the count attribute
    • getUsers

      public List<String> getUsers()
      Specified by:
      getUsers in interface ReactionIF
      Returns:
      The value of the users attribute
    • withName

      public final Reaction 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 or the this object
    • withCount

      public final Reaction withCount(int value)
      Copy the current immutable object by setting a value for the count attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for count
      Returns:
      A modified copy or the this object
    • withUsers

      public final Reaction withUsers(String... elements)
      Copy the current immutable object with elements that replace the content of users.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withUsers

      public final Reaction withUsers(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of users. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of users elements to set
      Returns:
      A modified copy or this if not changed
    • equals

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

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

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

      public static Reaction.Builder builder()
      Creates a builder for Reaction.
       Reaction.builder()
          .setName(String) // required name
          .setCount(int) // required count
          .addUsers|addAllUsers(String) // users elements
          .build();
       
      Returns:
      A new Reaction builder