Class UserKey

java.lang.Object
com.atlassian.sal.api.user.UserKey
All Implemented Interfaces:
Serializable

public final class UserKey extends Object implements Serializable
Represents an identifier that uniquely identifies a user for the duration of its existence.
Since:
v2.10
See Also:
  • Constructor Details

    • UserKey

      public UserKey(@Nonnull String userkey)
      Default constructor: builds a UserKey from its string representation.
      Parameters:
      userkey - the string representation of a UserKey. Must not be null.
  • Method Details

    • getStringValue

      @Nonnull public String getStringValue()
      Returns a string representation of the current key.
      Returns:
      a string representation of the current key
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • fromLong

      public static UserKey fromLong(long userId)
      Builds a UserKey object from a long id. The id will be converted to a String first.
      Parameters:
      userId - a user ID
      Returns:
      a UserKey object