Class SlackEventWrapper<T extends SlackEvent>

java.lang.Object
com.hubspot.slack.client.models.events.SlackEventWrapper<T>
All Implemented Interfaces:
SlackEventWrapperIF<T>

@Generated(from="SlackEventWrapperIF", generator="Immutables") @ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class SlackEventWrapper<T extends SlackEvent> extends Object implements SlackEventWrapperIF<T>
Immutable implementation of SlackEventWrapperIF.

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

  • Method Details

    • getToken

      public String getToken()
      Specified by:
      getToken in interface SlackEventWrapperIF<T extends SlackEvent>
      Returns:
      The value of the token attribute
    • getTeamId

      public String getTeamId()
      Specified by:
      getTeamId in interface SlackEventWrapperIF<T extends SlackEvent>
      Returns:
      The value of the teamId attribute
    • getContextTeamId

      public Optional<String> getContextTeamId()
      Specified by:
      getContextTeamId in interface SlackEventWrapperIF<T extends SlackEvent>
      Returns:
      The value of the contextTeamId attribute
    • getType

      public SlackEventType getType()
      Specified by:
      getType in interface SlackEventWrapperIF<T extends SlackEvent>
      Returns:
      The value of the type attribute
    • getAuthedUsers

      public List<String> getAuthedUsers()
      Specified by:
      getAuthedUsers in interface SlackEventWrapperIF<T extends SlackEvent>
      Returns:
      The value of the authedUsers attribute
    • getEventId

      public String getEventId()
      Specified by:
      getEventId in interface SlackEventWrapperIF<T extends SlackEvent>
      Returns:
      The value of the eventId attribute
    • getEventTime

      public String getEventTime()
      Specified by:
      getEventTime in interface SlackEventWrapperIF<T extends SlackEvent>
      Returns:
      The value of the eventTime attribute
    • getEvent

      public T getEvent()
      Specified by:
      getEvent in interface SlackEventWrapperIF<T extends SlackEvent>
      Returns:
      The value of the event attribute
    • withToken

      public final SlackEventWrapper<T> withToken(String value)
      Copy the current immutable object by setting a value for the token attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for token
      Returns:
      A modified copy or the this object
    • withTeamId

      public final SlackEventWrapper<T> withTeamId(String value)
      Copy the current immutable object by setting a value for the teamId attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for teamId
      Returns:
      A modified copy or the this object
    • withContextTeamId

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

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

      public final SlackEventWrapper<T> withType(SlackEventType value)
      Copy the current immutable object by setting a value for the type attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for type
      Returns:
      A modified copy or the this object
    • withAuthedUsers

      public final SlackEventWrapper<T> withAuthedUsers(String... elements)
      Copy the current immutable object with elements that replace the content of authedUsers.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withAuthedUsers

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

      public final SlackEventWrapper<T> withEventId(String value)
      Copy the current immutable object by setting a value for the eventId attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for eventId
      Returns:
      A modified copy or the this object
    • withEventTime

      public final SlackEventWrapper<T> withEventTime(String value)
      Copy the current immutable object by setting a value for the eventTime attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for eventTime
      Returns:
      A modified copy or the this object
    • withEvent

      public final SlackEventWrapper<T> withEvent(T value)
      Copy the current immutable object by setting a value for the event attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for event
      Returns:
      A modified copy or the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of SlackEventWrapper 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: token, teamId, contextTeamId, type, authedUsers, eventId, eventTime, event.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static <T extends SlackEvent> SlackEventWrapper<T> copyOf(SlackEventWrapperIF<T> instance)
      Creates an immutable copy of a SlackEventWrapperIF value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Type Parameters:
      T - generic parameter T
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable SlackEventWrapper instance
    • builder

      public static <T extends SlackEvent> SlackEventWrapper.Builder<T> builder()
      Creates a builder for SlackEventWrapper.
       SlackEventWrapper.<T>builder()
          .setToken(String) // required token
          .setTeamId(String) // required teamId
          .setContextTeamId(Optional<String>) // optional contextTeamId
          .setType(com.hubspot.slack.client.models.events.SlackEventType) // required type
          .addAuthedUsers|addAllAuthedUsers(String) // authedUsers elements
          .setEventId(String) // required eventId
          .setEventTime(String) // required eventTime
          .setEvent(T) // required event
          .build();
       
      Type Parameters:
      T - generic parameter T
      Returns:
      A new SlackEventWrapper builder