com.atlassian.crowd.embedded.impl
Class ImmutableUser

java.lang.Object
  extended by com.atlassian.crowd.embedded.impl.ImmutableUser
All Implemented Interfaces:
User, Serializable, Comparable<User>, Principal

public class ImmutableUser
extends Object
implements User, Serializable

A general purpose immutable implementation of the User interface. Note: This object does not allow null username or directoryId.

See Also:
Serialized Form

Nested Class Summary
static class ImmutableUser.Builder
          Used to aid in the construction of an Immutable User object.
 
Constructor Summary
ImmutableUser(long directoryId, String name, String displayName, String emailAddress, boolean active)
           
 
Method Summary
 int compareTo(User other)
           
 boolean equals(Object o)
           
 long getDirectoryId()
           
 String getDisplayName()
           
 String getEmailAddress()
           
 String getName()
           
 int hashCode()
           
 boolean isActive()
           
static ImmutableUser.Builder newUser()
           
static ImmutableUser.Builder newUser(User user)
          Creates a new User Builder by cloning the values from the supplied User.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.security.Principal
toString
 

Constructor Detail

ImmutableUser

public ImmutableUser(long directoryId,
                     @Nonnull
                     String name,
                     String displayName,
                     String emailAddress,
                     boolean active)
Method Detail

isActive

public boolean isActive()
Specified by:
isActive in interface User

getDirectoryId

public long getDirectoryId()
Specified by:
getDirectoryId in interface User

getName

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

getEmailAddress

public String getEmailAddress()
Specified by:
getEmailAddress in interface User

getDisplayName

public String getDisplayName()
Specified by:
getDisplayName in interface User

equals

public boolean equals(Object o)
Specified by:
equals in interface User
Specified by:
equals in interface Principal
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface User
Specified by:
hashCode in interface Principal
Overrides:
hashCode in class Object

compareTo

public int compareTo(User other)
Specified by:
compareTo in interface User
Specified by:
compareTo in interface Comparable<User>

newUser

public static ImmutableUser.Builder newUser()

newUser

public static ImmutableUser.Builder newUser(User user)
Creates a new User Builder by cloning the values from the supplied User.

Parameters:
user - user to be cloned.
Returns:
a User Builder containing the values from the supplied User.


Copyright © 2014 Atlassian. All Rights Reserved.