Package de.bp2019.pusl.model
Class User
- java.lang.Object
-
- de.bp2019.pusl.model.User
-
- All Implemented Interfaces:
Serializable
,org.springframework.security.core.userdetails.UserDetails
public class User extends Object implements org.springframework.security.core.userdetails.UserDetails
Model of a User. ImplementsUserDetails
to be used with Spring Security. Is a Database Entity.- Author:
- Leon Chemnitz
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
Collection<? extends org.springframework.security.core.GrantedAuthority>
getAuthorities()
String
getEmailAddress()
String
getFirstName()
String
getFullName()
Get the full name of a user.org.bson.types.ObjectId
getId()
Set<Institute>
getInstitutes()
String
getLastName()
String
getPassword()
UserType
getType()
String
getUsername()
int
hashCode()
boolean
isAccountNonExpired()
boolean
isAccountNonLocked()
boolean
isCredentialsNonExpired()
boolean
isEnabled()
void
setEmailAddress(String eMail)
void
setFirstName(String firstName)
void
setId(org.bson.types.ObjectId id)
void
setInstitutes(Set<Institute> institutes)
void
setLastName(String lastName)
void
setPassword(String password)
void
setType(UserType type)
String
toString()
-
-
-
Method Detail
-
getAuthorities
public Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities()
- Specified by:
getAuthorities
in interfaceorg.springframework.security.core.userdetails.UserDetails
-
getFullName
public String getFullName()
Get the full name of a user. Returns the users email address if no firstname is set- Returns:
- Full name of the found User. Empty String if no user is found
-
getUsername
public String getUsername()
- Specified by:
getUsername
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
-
getId
public org.bson.types.ObjectId getId()
-
setId
public void setId(org.bson.types.ObjectId id)
-
getFirstName
public String getFirstName()
-
setFirstName
public void setFirstName(String firstName)
-
getLastName
public String getLastName()
-
setLastName
public void setLastName(String lastName)
-
getEmailAddress
public String getEmailAddress()
-
setEmailAddress
public void setEmailAddress(String eMail)
-
getPassword
public String getPassword()
- Specified by:
getPassword
in interfaceorg.springframework.security.core.userdetails.UserDetails
-
setPassword
public void setPassword(String password)
-
getType
public UserType getType()
-
setType
public void setType(UserType type)
-
-