Class SlackUserLite

java.lang.Object
com.hubspot.slack.client.models.users.SlackUserLite
All Implemented Interfaces:
SlackUserCore, SlackUserLiteIF

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

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

  • Method Details

    • getId

      public String getId()
      Specified by:
      getId in interface SlackUserCore
      Returns:
      The value of the id attribute
    • getUsername

      public Optional<String> getUsername()
      Specified by:
      getUsername in interface SlackUserCore
      Returns:
      The value of the username attribute
    • getAccessToken

      public Optional<String> getAccessToken()
      Specified by:
      getAccessToken in interface SlackUserLiteIF
      Returns:
      The value of the accessToken attribute
    • withId

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

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

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

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

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

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

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

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

      public static SlackUserLite.Builder builder()
      Creates a builder for SlackUserLite.
       SlackUserLite.builder()
          .setId(String) // required id
          .setUsername(Optional<String>) // optional username
          .setAccessToken(Optional<String>) // optional accessToken
          .build();
       
      Returns:
      A new SlackUserLite builder