Class SlackUser

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

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

Use the builder to create immutable instances: SlackUser.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
    • getProfile

      public Optional<UserProfile> getProfile()
      Specified by:
      getProfile in interface SlackUserIF
      Returns:
      The value of the profile attribute
    • isDeleted

      public Optional<Boolean> isDeleted()
      Specified by:
      isDeleted in interface SlackUserIF
      Returns:
      The value of the deleted attribute
    • getColor

      public Optional<String> getColor()
      Specified by:
      getColor in interface SlackUserIF
      Returns:
      The value of the color attribute
    • isAdmin

      public Optional<String> isAdmin()
      Specified by:
      isAdmin in interface SlackUserIF
      Returns:
      The value of the admin attribute
    • isOwner

      public Optional<String> isOwner()
      Specified by:
      isOwner in interface SlackUserIF
      Returns:
      The value of the owner attribute
    • getTeamId

      public Optional<String> getTeamId()
      Specified by:
      getTeamId in interface SlackUserIF
      Returns:
      The value of the teamId attribute
    • getExternalTeamId

      public Optional<String> getExternalTeamId()
      For external (Slack Connect) users cached against a workspace they do not belong to, this holds their real home workspace team ID; getTeamId() then holds the workspace the user is cached/scoped under. Empty for regular (internal) users, so its presence is the single source of truth for whether a user is external.
      Specified by:
      getExternalTeamId in interface SlackUserIF
    • isExternal

      public boolean isExternal()
      Whether this user is external (a Slack Connect member) relative to the workspace this record is scoped to. Derived purely from getExternalTeamId() — there is no separate persisted/serialized field, so all logic can rely on this convenience method.
      Specified by:
      isExternal in interface SlackUserIF
    • getRealName

      public Optional<String> getRealName()
      Specified by:
      getRealName in interface SlackUserIF
      Returns:
      The value of the realName attribute
    • isPrimaryOwner

      public Optional<Boolean> isPrimaryOwner()
      Specified by:
      isPrimaryOwner in interface SlackUserIF
      Returns:
      The value of the primaryOwner attribute
    • isRestricted

      public Optional<Boolean> isRestricted()
      Specified by:
      isRestricted in interface SlackUserIF
      Returns:
      The value of the restricted attribute
    • isUltraRestricted

      public Optional<Boolean> isUltraRestricted()
      Specified by:
      isUltraRestricted in interface SlackUserIF
      Returns:
      The value of the ultraRestricted attribute
    • isBot

      public Optional<Boolean> isBot()
      Specified by:
      isBot in interface SlackUserIF
      Returns:
      The value of the bot attribute
    • isAppUser

      public Optional<Boolean> isAppUser()
      Specified by:
      isAppUser in interface SlackUserIF
      Returns:
      The value of the appUser attribute
    • getTimezone

      public Optional<String> getTimezone()
      Specified by:
      getTimezone in interface SlackUserIF
      Returns:
      The value of the timezone attribute
    • getTimezoneLabel

      public Optional<String> getTimezoneLabel()
      Specified by:
      getTimezoneLabel in interface SlackUserIF
      Returns:
      The value of the timezoneLabel attribute
    • getTimezoneOffset

      public Optional<String> getTimezoneOffset()
      Specified by:
      getTimezoneOffset in interface SlackUserIF
      Returns:
      The value of the timezoneOffset attribute
    • getRawUpdated

      public Optional<Integer> getRawUpdated()
      Specified by:
      getRawUpdated in interface SlackUserIF
      Returns:
      The value of the rawUpdated attribute
    • getLocale

      public Optional<String> getLocale()
      Specified by:
      getLocale in interface SlackUserIF
      Returns:
      The value of the locale attribute
    • getUpdatedAt

      public Optional<Long> getUpdatedAt()
      Specified by:
      getUpdatedAt in interface SlackUserIF
      Returns:
      The computed-at-construction value of the updatedAt attribute
    • withId

      public final SlackUser 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 SlackUser 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 SlackUser 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
    • withProfile

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

      public final SlackUser withProfile(Optional<? extends UserProfile> optional)
      Copy the current immutable object by setting an optional value for the profile attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for profile
      Returns:
      A modified copy or this if not changed
    • withDeleted

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

      public final SlackUser withDeleted(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the deleted 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 deleted
      Returns:
      A modified copy or this if not changed
    • withColor

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

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

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

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

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

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

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

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

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

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

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

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

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

      public final SlackUser withPrimaryOwner(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the primaryOwner 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 primaryOwner
      Returns:
      A modified copy or this if not changed
    • withRestricted

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

      public final SlackUser withRestricted(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the restricted 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 restricted
      Returns:
      A modified copy or this if not changed
    • withUltraRestricted

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

      public final SlackUser withUltraRestricted(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the ultraRestricted 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 ultraRestricted
      Returns:
      A modified copy or this if not changed
    • withBot

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

      public final SlackUser withBot(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the bot 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 bot
      Returns:
      A modified copy or this if not changed
    • withAppUser

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

      public final SlackUser withAppUser(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the appUser 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 appUser
      Returns:
      A modified copy or this if not changed
    • withTimezone

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

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

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

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

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

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

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

      public final SlackUser withRawUpdated(Optional<Integer> optional)
      Copy the current immutable object by setting an optional value for the rawUpdated 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 rawUpdated
      Returns:
      A modified copy or this if not changed
    • withLocale

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

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

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of SlackUser 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, profile, deleted, color, admin, owner, teamId, externalTeamId, external, realName, primaryOwner, restricted, ultraRestricted, bot, appUser, timezone, timezoneLabel, timezoneOffset, rawUpdated, locale, updatedAt.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static SlackUser.Builder builder()
      Creates a builder for SlackUser.
       SlackUser.builder()
          .setId(String) // required id
          .setUsername(Optional<String>) // optional username
          .setProfile(Optional<UserProfile>) // optional profile
          .setDeleted(Optional<Boolean>) // optional deleted
          .setColor(Optional<String>) // optional color
          .setAdmin(Optional<String>) // optional admin
          .setOwner(Optional<String>) // optional owner
          .setTeamId(Optional<String>) // optional teamId
          .setExternalTeamId(Optional<String>) // optional externalTeamId
          .setRealName(Optional<String>) // optional realName
          .setPrimaryOwner(Optional<Boolean>) // optional primaryOwner
          .setRestricted(Optional<Boolean>) // optional restricted
          .setUltraRestricted(Optional<Boolean>) // optional ultraRestricted
          .setBot(Optional<Boolean>) // optional bot
          .setAppUser(Optional<Boolean>) // optional appUser
          .setTimezone(Optional<String>) // optional timezone
          .setTimezoneLabel(Optional<String>) // optional timezoneLabel
          .setTimezoneOffset(Optional<String>) // optional timezoneOffset
          .setRawUpdated(Optional<Integer>) // optional rawUpdated
          .setLocale(Optional<String>) // optional locale
          .build();
       
      Returns:
      A new SlackUser builder