Package com.randomnoun.common.security
Class User
java.lang.Object
com.randomnoun.common.security.User
- All Implemented Interfaces:
Serializable
A class encapsulating information to define an end-user.
- Author:
- knoxg
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Two users are considered identical if their customerIds and usernames are identicallong
Returns the customerId partly identifying this user.Returns the locale for this user.long
Returns the userId for this userReturns the username partly identifying this user.int
hashCode()
Must override hasCode() if we override equals().void
setCustomerId
(long customerId) Sets the customerId that partly identifies this user.void
Sets the locale for this user.void
setUserId
(long userId) Sets the userId for this uservoid
setUsername
(String username) Sets the username that partly identifies this user.toString()
Returns a string representation of this user (used for debugging only).
-
Constructor Details
-
User
public User()
-
-
Method Details
-
setUsername
Sets the username that partly identifies this user. (Within a realm, both username and customerId must be used to uniquely identify a user).- Parameters:
value
- the username for this user
-
getUsername
Returns the username partly identifying this user. (Within a realm, both username and customerId must be used to uniquely identify a user).- Returns:
- the username for this user.
-
setCustomerId
Sets the customerId that partly identifies this user. (Both username and customerId must be used to uniquely identify a user).- Parameters:
value
- the customerId for this user
-
getCustomerId
Returns the customerId partly identifying this user. (Both username and customerId must be used to uniquely identify a user).- Returns:
- the customerId for this user.
-
setLocale
Sets the locale for this user. The locale is used to localise text that will be sent to the user.- Parameters:
value
- the locale for this user
-
getLocale
Returns the locale for this user.- Returns:
- the locale for this user.
-
setUserId
Sets the userId for this user- Parameters:
userId
- the userId for this user
-
getUserId
Returns the userId for this user- Returns:
- the userId the userId for this user
-
toString
Returns a string representation of this user (used for debugging only). This representation includes the username, customerId, roles and permissions stored for this user -
equals
Two users are considered identical if their customerIds and usernames are identical -
hashCode
Must override hasCode() if we override equals().
-