SPT Core API

com.sptci.auth
Class User

java.lang.Object
  extended by com.sptci.auth.User
All Implemented Interfaces:
Serializable

public class User
extends Object
implements Serializable

A value object that represents a user object. This bean is used to store the values necessary to implement authentication and authorisation.

© Copyright 2006, Sans Pareil Technologies, Inc.

Version:
$Id: User.java 4553 2008-12-24 10:34:16Z rakesh $
Author:
Rakesh Vidyadharan 2006-11-15
See Also:
Serialized Form

Field Summary
 Collection<Group> groups
          The collection of groups to which this user belongs.
static int HASH
          The default value for hash code.
 char[] password
          The password of the user.
 String userName
          The userName of the user.
 
Constructor Summary
User(String userName, char[] password, Collection<Group> groups)
          Create a new instance using the specified values.
User(String userName, String password, Collection<Group> groups)
          Create a new instance using the specified values.
 
Method Summary
 boolean equals(Object object)
          Compares the specified object with this instance for equality.
 int hashCode()
          Calculate a hash code for the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

userName

public final String userName
The userName of the user.


password

public final transient char[] password
The password of the user.


groups

public final Collection<Group> groups
The collection of groups to which this user belongs.


HASH

public static final int HASH
The default value for hash code.

See Also:
Constant Field Values
Constructor Detail

User

public User(String userName,
            String password,
            Collection<Group> groups)
Create a new instance using the specified values.

Parameters:
userName - The userName value to use.
password - The password value to use.
groups - The groups value to use.

User

public User(String userName,
            char[] password,
            Collection<Group> groups)
Create a new instance using the specified values.

Parameters:
userName - The userName value to use.
password - The password value to use.
groups - The groups value to use.
Method Detail

equals

public boolean equals(Object object)
Compares the specified object with this instance for equality. Two instances are equal if they have the same values for the class fields.

Overrides:
equals in class Object
Parameters:
object - The object that is to be tested for equality.
Returns:
Returns true if the specified object is of the same type and has the same values.

hashCode

public int hashCode()
Calculate a hash code for the object.

Overrides:
hashCode in class Object
Returns:
The hash code for this instance.

SPT Core API