public class MockApplicationUser extends Object implements ApplicationUser
ApplicationUser.| Modifier and Type | Field and Description |
|---|---|
static long |
FAKE_USER_DIRECTORY_ID |
static AtomicLong |
SEQUENCE |
ID_COMPARATOR| Constructor and Description |
|---|
MockApplicationUser(String username)
Uses the
lowercase form of
the supplied username as the key. |
MockApplicationUser(String username,
long directoryId) |
MockApplicationUser(String userKey,
String username)
Uses the given key as-is.
|
MockApplicationUser(String username,
String displayName,
String email)
Uses the
lowercase form of
the supplied username as the key. |
MockApplicationUser(String userKey,
String username,
String displayName,
String email)
Uses the given key as-is.
|
MockApplicationUser(String userKey,
com.atlassian.crowd.embedded.api.User user) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj)
Implementations must ensure equality based on getKey().
|
long |
getDirectoryId() |
com.atlassian.crowd.embedded.api.User |
getDirectoryUser() |
String |
getDisplayName()
Returns the display name of the user.
|
String |
getEmailAddress() |
Long |
getId() |
String |
getKey()
Returns the key which distinguishes the ApplicationUser as unique.
|
String |
getName()
Synonym for
ApplicationUser.getUsername() and implementation of Principal.getName(). |
String |
getUsername() |
int |
hashCode()
Implementations must produce a hashcode based on getKey().
|
boolean |
isActive()
A
MockUser is always active by default. |
MockApplicationUser |
setActive(boolean active) |
String |
toString() |
public static final AtomicLong SEQUENCE
public static final long FAKE_USER_DIRECTORY_ID
public MockApplicationUser(String username)
lowercase form of
the supplied username as the key.username - as for MockUser.MockUser(String)public MockApplicationUser(String username, long directoryId)
public MockApplicationUser(String username, String displayName, String email)
lowercase form of
the supplied username as the key.username - as for MockUser.MockUser(String, String, String)displayName - as for MockUser.MockUser(String, String, String)email - as for MockUser.MockUser(String, String, String)public MockApplicationUser(String userKey, String username)
userKey - desired user's Key, the value to be returned for ApplicationUser.getKey()username - as for MockUser.MockUser(String)public MockApplicationUser(String userKey, String username, String displayName, String email)
userKey - desired user's Key, the value to be returned for ApplicationUser.getKey()username - as for MockUser.MockUser(String, String, String)displayName - as for MockUser.MockUser(String, String, String)email - as for MockUser.MockUser(String, String, String)public MockApplicationUser(String userKey, com.atlassian.crowd.embedded.api.User user)
public boolean isActive()
MockUser is always active by default.isActive in interface ApplicationUsertrue if this user is active.public MockApplicationUser setActive(boolean active)
public String getKey()
ApplicationUserUsers with the same username (ignoring case) across all user
directories.getKey in interface WithKeygetKey in interface ApplicationUserpublic String getEmailAddress()
getEmailAddress in interface ApplicationUserpublic String getDisplayName()
ApplicationUsergetDisplayName in interface ApplicationUserpublic com.atlassian.crowd.embedded.api.User getDirectoryUser()
getDirectoryUser in interface ApplicationUserpublic String getUsername()
getUsername in interface ApplicationUsernull.ApplicationUser.getName()public String getName()
ApplicationUserApplicationUser.getUsername() and implementation of Principal.getName().getName in interface ApplicationUsergetName in interface Principalnull.ApplicationUser.getUsername()public long getDirectoryId()
getDirectoryId in interface ApplicationUserpublic boolean equals(Object obj)
ApplicationUserpublic int hashCode()
ApplicationUserpublic String toString()
Copyright © 2002-2017 Atlassian. All Rights Reserved.