Package org.gbif.api.model.common
Class AbstractGbifUser
java.lang.Object
org.gbif.api.model.common.AbstractGbifUser
- Direct Known Subclasses:
GbifUser
An abstract GBIF user account. The main purpose of this abstraction is to let subclasses handle
key and password information only if required. By doing so, it is possible to have classes
working for user information without having to carry those information around.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
@NotNull @ValidEmail String
getEmail()
getName()
getRoles()
Gets the settings which may be empty but never null.Gets the settings which may be empty but never null.@NotNull @Pattern(regexp="^[a-z0-9_.-]+$") @Size(min=3,max=64) String
The unique, immutable drupal user account name.int
hashCode()
boolean
Checks if the user has the given user role.void
setDeleted
(Date deleted) void
void
setFirstName
(String firstName) void
setLastName
(String lastName) void
void
setSettings
(Map<String, String> settings) Sets the settings object, setting an empty map if null is provided.void
setSystemSettings
(Map<String, String> systemSettings) Sets the settings object, setting an empty map if null is provided.void
setUserName
(String userName) toString()
-
Constructor Details
-
AbstractGbifUser
public AbstractGbifUser()
-
-
Method Details
-
getEmail
-
setEmail
-
getUserName
@NotNull @Pattern(regexp="^[a-z0-9_.-]+$") @Size(min=3, max=64) public @NotNull @Pattern(regexp="^[a-z0-9_.-]+$") @Size(min=3,max=64) String getUserName()The unique, immutable drupal user account name. This name should be used for referring to a user. The account name is made of ASCII lower case alphanumerics, underscore, dash or dots and is in particular void of whitespace. -
setUserName
-
getFirstName
- Returns:
- the first name of a person
-
setFirstName
-
getLastName
- Returns:
- the last name of the user
-
setLastName
-
getName
- Returns:
- the first and last name of the user concatenated with a space
-
getRoles
-
setRoles
-
addRole
-
hasRole
Checks if the user has the given user role.- Parameters:
role
- user role- Returns:
- true if the user has the requested role
-
setSettings
Sets the settings object, setting an empty map if null is provided. -
getSettings
Gets the settings which may be empty but never null. -
setSystemSettings
Sets the settings object, setting an empty map if null is provided. -
getSystemSettings
Gets the settings which may be empty but never null. -
getDeleted
-
setDeleted
-
getLocale
-
equals
-
hashCode
-
toString
-