com.atlassian.jira.user
Class DelegatingApplicationUser

java.lang.Object
  extended by com.atlassian.jira.user.DelegatingApplicationUser
All Implemented Interfaces:
ApplicationUser, Principal
Direct Known Subclasses:
MockApplicationUser

public class DelegatingApplicationUser
extends Object
implements ApplicationUser

An ApplicationUser comprising of a String key and an embedded crowd User.

Since:
v5.1.1

Constructor Summary
DelegatingApplicationUser(String key, com.atlassian.crowd.embedded.api.User user)
           
 
Method Summary
 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()
           
 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()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DelegatingApplicationUser

public DelegatingApplicationUser(String key,
                                 com.atlassian.crowd.embedded.api.User user)
Method Detail

getKey

public String getKey()
Description copied from interface: ApplicationUser
Returns the key which distinguishes the ApplicationUser as unique. The same key is shared by all Users with the same username (ignoring case) across all user directories.

Specified by:
getKey in interface ApplicationUser
Returns:
the key which distinguishes the ApplicationUser as unique

isActive

public boolean isActive()
Specified by:
isActive in interface ApplicationUser
Returns:
true if this user is active.

getEmailAddress

public String getEmailAddress()
Specified by:
getEmailAddress in interface ApplicationUser
Returns:
email address of the user.

getDisplayName

public String getDisplayName()
Description copied from interface: ApplicationUser
Returns the display name of the user. This is sometimes referred to as "full name".

Specified by:
getDisplayName in interface ApplicationUser
Returns:
display name of the user, must never be null.

getDirectoryUser

public com.atlassian.crowd.embedded.api.User getDirectoryUser()
Specified by:
getDirectoryUser in interface ApplicationUser
Returns:
the user as seen by the particular user directory that this User is defined in.

getUsername

public String getUsername()
Specified by:
getUsername in interface ApplicationUser
Returns:
the username (login) of the user; must never be null.
See Also:
ApplicationUser.getName()

getName

public String getName()
Description copied from interface: ApplicationUser
Synonym for ApplicationUser.getUsername() and implementation of Principal.getName().

Specified by:
getName in interface ApplicationUser
Specified by:
getName in interface Principal
Returns:
the username (login) of the user; must never be null.
See Also:
ApplicationUser.getUsername()

getDirectoryId

public long getDirectoryId()
Specified by:
getDirectoryId in interface ApplicationUser
Returns:
the ID of the user directory that this user comes from.

equals

public boolean equals(Object obj)
Description copied from interface: ApplicationUser
Implementations must ensure equality based on getKey().

Specified by:
equals in interface ApplicationUser
Specified by:
equals in interface Principal
Overrides:
equals in class Object
Parameters:
obj - object to compare to.
Returns:
true if and only if the key matches.

hashCode

public int hashCode()
Description copied from interface: ApplicationUser
Implementations must produce a hashcode based on getKey().

Specified by:
hashCode in interface ApplicationUser
Specified by:
hashCode in interface Principal
Overrides:
hashCode in class Object
Returns:
hashcode.

toString

public String toString()
Specified by:
toString in interface Principal
Overrides:
toString in class Object


Copyright © 2002-2013 Atlassian. All Rights Reserved.