Class User
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.model.IridaRepresentationModel
-
- ca.corefacility.bioinformatics.irida.model.user.User
-
- All Implemented Interfaces:
IridaThing
,MutableIridaThing
,Timestamped<java.lang.Long>
,java.io.Serializable
,java.lang.Comparable<User>
,org.springframework.security.core.userdetails.UserDetails
@Entity public class User extends IridaRepresentationModel implements MutableIridaThing, java.lang.Comparable<User>, org.springframework.security.core.userdetails.UserDetails
A user object.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
USER_EMAIL_CONSTRAINT_NAME
static java.lang.String
USER_USERNAME_CONSTRAINT_NAME
-
Constructor Summary
Constructors Constructor Description User()
Construct an instance ofUser
with no properties set.User(java.lang.Long id, java.lang.String username, java.lang.String email, java.lang.String password, java.lang.String firstName, java.lang.String lastName, java.lang.String phoneNumber)
Construct an instance ofUser
with all properties set.User(java.lang.String username, java.lang.String email, java.lang.String password, java.lang.String firstName, java.lang.String lastName, java.lang.String phoneNumber)
Construct an instance ofUser
with all properties (except identifier) set.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(User u)
boolean
equals(java.lang.Object other)
java.util.Collection<? extends org.springframework.security.core.GrantedAuthority>
getAuthorities()
java.util.Date
getCreatedDate()
Get the created date of the objectjava.lang.String
getEmail()
java.lang.String
getFirstName()
java.lang.Long
getId()
Get the numerical identifier for this objectjava.lang.String
getLabel()
Get a human readable label for this object.java.util.Date
getLastLogin()
java.lang.String
getLastName()
java.lang.String
getLocale()
java.util.Date
getModifiedDate()
Get the date that this object was last modifiedjava.lang.String
getPassword()
java.lang.String
getPhoneNumber()
Role
getSystemRole()
java.lang.String
getUsername()
int
hashCode()
boolean
isAccountNonExpired()
boolean
isAccountNonLocked()
boolean
isCredentialsNonExpired()
boolean
isEnabled()
void
setCredentialsNonExpired(boolean credentialsNonExpired)
void
setEmail(java.lang.String email)
void
setEnabled(boolean valid)
void
setFirstName(java.lang.String firstName)
void
setId(java.lang.Long id)
Set the numerical identifier for this objectvoid
setLastName(java.lang.String lastName)
void
setLocale(java.lang.String locale)
void
setModifiedDate(java.util.Date modifiedDate)
Set the modification time of this objectvoid
setPassword(java.lang.String password)
void
setPhoneNumber(java.lang.String phoneNumber)
void
setSystemRole(Role systemRole)
void
setUsername(java.lang.String username)
java.lang.String
toString()
-
Methods inherited from class ca.corefacility.bioinformatics.irida.model.IridaRepresentationModel
add, add, getLink, getLinks, getRemoteStatus, getSelfHref, hasLink, hasLinks, removeLinks, setRemoteStatus
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ca.corefacility.bioinformatics.irida.model.IridaThing
getIdentifier, setLabel
-
-
-
-
Field Detail
-
USER_EMAIL_CONSTRAINT_NAME
public static final java.lang.String USER_EMAIL_CONSTRAINT_NAME
- See Also:
- Constant Field Values
-
USER_USERNAME_CONSTRAINT_NAME
public static final java.lang.String USER_USERNAME_CONSTRAINT_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
User
public User()
Construct an instance ofUser
with no properties set.
-
User
public User(java.lang.String username, java.lang.String email, java.lang.String password, java.lang.String firstName, java.lang.String lastName, java.lang.String phoneNumber)
Construct an instance ofUser
with all properties (except identifier) set.
-
User
public User(java.lang.Long id, java.lang.String username, java.lang.String email, java.lang.String password, java.lang.String firstName, java.lang.String lastName, java.lang.String phoneNumber)
Construct an instance ofUser
with all properties set.
-
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classIridaRepresentationModel
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classIridaRepresentationModel
-
getId
public java.lang.Long getId()
Description copied from interface:IridaThing
Get the numerical identifier for this object- Specified by:
getId
in interfaceIridaThing
- Specified by:
getId
in interfaceTimestamped<java.lang.Long>
- Returns:
- the numerical identifier for the object
-
setId
public void setId(java.lang.Long id)
Description copied from interface:MutableIridaThing
Set the numerical identifier for this object- Specified by:
setId
in interfaceMutableIridaThing
- Parameters:
id
- The ID to set
-
compareTo
public int compareTo(User u)
- Specified by:
compareTo
in interfacejava.lang.Comparable<User>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classIridaRepresentationModel
-
getUsername
public java.lang.String getUsername()
- Specified by:
getUsername
in interfaceorg.springframework.security.core.userdetails.UserDetails
-
setUsername
public void setUsername(java.lang.String username)
-
getEmail
public java.lang.String getEmail()
-
setEmail
public void setEmail(java.lang.String email)
-
getPassword
public java.lang.String getPassword()
- Specified by:
getPassword
in interfaceorg.springframework.security.core.userdetails.UserDetails
-
setPassword
public void setPassword(java.lang.String password)
-
getFirstName
public java.lang.String getFirstName()
-
setFirstName
public void setFirstName(java.lang.String firstName)
-
getLastName
public java.lang.String getLastName()
-
setLastName
public void setLastName(java.lang.String lastName)
-
getPhoneNumber
public java.lang.String getPhoneNumber()
-
setPhoneNumber
public void setPhoneNumber(java.lang.String phoneNumber)
-
getLabel
public java.lang.String getLabel()
Description copied from interface:IridaThing
Get a human readable label for this object.- Specified by:
getLabel
in interfaceIridaThing
- Returns:
- a human-readable label for the object.
-
getAuthorities
public java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities()
- Specified by:
getAuthorities
in interfaceorg.springframework.security.core.userdetails.UserDetails
-
isAccountNonExpired
public boolean isAccountNonExpired()
- Specified by:
isAccountNonExpired
in interfaceorg.springframework.security.core.userdetails.UserDetails
-
isAccountNonLocked
public boolean isAccountNonLocked()
- Specified by:
isAccountNonLocked
in interfaceorg.springframework.security.core.userdetails.UserDetails
-
isCredentialsNonExpired
public boolean isCredentialsNonExpired()
- Specified by:
isCredentialsNonExpired
in interfaceorg.springframework.security.core.userdetails.UserDetails
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabled
in interfaceorg.springframework.security.core.userdetails.UserDetails
-
setEnabled
public void setEnabled(boolean valid)
-
getModifiedDate
public java.util.Date getModifiedDate()
Description copied from interface:MutableIridaThing
Get the date that this object was last modified- Specified by:
getModifiedDate
in interfaceMutableIridaThing
- Returns:
Date
object of the modified date
-
setModifiedDate
public void setModifiedDate(java.util.Date modifiedDate)
Description copied from interface:MutableIridaThing
Set the modification time of this object- Specified by:
setModifiedDate
in interfaceMutableIridaThing
- Parameters:
modifiedDate
- The date where this object was modified
-
getSystemRole
public Role getSystemRole()
-
setCredentialsNonExpired
public void setCredentialsNonExpired(boolean credentialsNonExpired)
-
getLocale
public java.lang.String getLocale()
-
setLocale
public void setLocale(java.lang.String locale)
-
getCreatedDate
public java.util.Date getCreatedDate()
Description copied from interface:Timestamped
Get the created date of the object- Specified by:
getCreatedDate
in interfaceTimestamped<java.lang.Long>
- Returns:
- A
Date
object of the created date
-
setSystemRole
public void setSystemRole(Role systemRole)
-
getLastLogin
public java.util.Date getLastLogin()
-
-