com.atlassian.jira.user
Class MockUser

java.lang.Object
  extended by com.atlassian.jira.user.MockUser
All Implemented Interfaces:
com.atlassian.crowd.embedded.api.Attributes, com.atlassian.crowd.embedded.api.User, com.atlassian.crowd.embedded.api.UserWithAttributes, ApplicationUser, Comparable<com.atlassian.crowd.embedded.api.User>, Principal

public class MockUser
extends Object
implements com.atlassian.crowd.embedded.api.UserWithAttributes, ApplicationUser

Since:
v4.3

Constructor Summary
MockUser(String username)
           
MockUser(String username, String fullName, String email)
           
MockUser(String username, String fullName, String email, Map<String,Set<String>> values)
           
 
Method Summary
 int compareTo(com.atlassian.crowd.embedded.api.User other)
           
 boolean equals(Object o)
          Implementations must ensure equality based on getKey().
 long getDirectoryId()
           
 String getDisplayName()
           
 String getEmailAddress()
           
 String getKey()
          Returns the key which distinguishes the ApplicationUser as unique.
 Set<String> getKeys()
           
 String getName()
           
 String getValue(String key)
           
 Set<String> getValues(String key)
           
 int hashCode()
          Implementations must produce a hashcode based on getKey().
 boolean isActive()
           
 boolean isEmpty()
           
 void setActive(boolean active)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MockUser

public MockUser(String username)

MockUser

public MockUser(String username,
                String fullName,
                String email)

MockUser

public MockUser(String username,
                String fullName,
                String email,
                Map<String,Set<String>> values)
Method Detail

isActive

public boolean isActive()
Specified by:
isActive in interface com.atlassian.crowd.embedded.api.User

setActive

public void setActive(boolean active)

getEmailAddress

public String getEmailAddress()
Specified by:
getEmailAddress in interface com.atlassian.crowd.embedded.api.User

getDisplayName

public String getDisplayName()
Specified by:
getDisplayName in interface com.atlassian.crowd.embedded.api.User

getDirectoryId

public long getDirectoryId()
Specified by:
getDirectoryId in interface com.atlassian.crowd.embedded.api.User

getName

public String getName()
Specified by:
getName in interface Principal

toString

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

getValues

public Set<String> getValues(String key)
Specified by:
getValues in interface com.atlassian.crowd.embedded.api.Attributes

getValue

public String getValue(String key)
Specified by:
getValue in interface com.atlassian.crowd.embedded.api.Attributes

getKeys

public Set<String> getKeys()
Specified by:
getKeys in interface com.atlassian.crowd.embedded.api.Attributes

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface com.atlassian.crowd.embedded.api.Attributes

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 directories.

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

equals

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

Specified by:
equals in interface com.atlassian.crowd.embedded.api.User
Specified by:
equals in interface ApplicationUser
Specified by:
equals in interface Principal
Overrides:
equals in class Object
Parameters:
o - 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 com.atlassian.crowd.embedded.api.User
Specified by:
hashCode in interface ApplicationUser
Specified by:
hashCode in interface Principal
Overrides:
hashCode in class Object
Returns:
hashcode.

compareTo

public int compareTo(com.atlassian.crowd.embedded.api.User other)
Specified by:
compareTo in interface com.atlassian.crowd.embedded.api.User
Specified by:
compareTo in interface Comparable<com.atlassian.crowd.embedded.api.User>


Copyright © 2002-2013 Atlassian. All Rights Reserved.