Class User
- java.lang.Object
-
- cz.zcu.students.cacha.bp_server.domain.User
-
- All Implemented Interfaces:
Serializable
,org.springframework.security.core.userdetails.UserDetails
@Entity public class User extends Object implements org.springframework.security.core.userdetails.UserDetails
Class that represents user of translation system- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description User()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
Gets whether two instances represents the same userCollection<? extends org.springframework.security.core.GrantedAuthority>
getAuthorities()
Gets all authorities represented by roles that user hasint
hashCode()
Gets the hash codeboolean
isAccountNonExpired()
indicates whether is account expiredboolean
isAccountNonLocked()
indicates if the account is lockedboolean
isAdmin()
Gets whether user is an administratorboolean
isCredentialsNonExpired()
gets if user's credentials are expiredboolean
isEnabled()
gets whether user is bannedboolean
isInstitutionOwner()
Gets whether user manages an institutionboolean
isTranslator()
Gets whether user is translatorprotected void
onCreate()
Sets default values for newly crated user
-
-
-
Method Detail
-
onCreate
protected void onCreate()
Sets default values for newly crated user
-
getAuthorities
public Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities()
Gets all authorities represented by roles that user has- Specified by:
getAuthorities
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- all user's authorities
-
isAccountNonExpired
public boolean isAccountNonExpired()
indicates whether is account expired- Specified by:
isAccountNonExpired
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- whether is account expired
-
isAccountNonLocked
public boolean isAccountNonLocked()
indicates if the account is locked- Specified by:
isAccountNonLocked
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- if the account is locked
-
isCredentialsNonExpired
public boolean isCredentialsNonExpired()
gets if user's credentials are expired- Specified by:
isCredentialsNonExpired
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- if user's credentials are expired
-
isEnabled
public boolean isEnabled()
gets whether user is banned- Specified by:
isEnabled
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- whether user is banned
-
isTranslator
public boolean isTranslator()
Gets whether user is translator- Returns:
- whether user is translator
-
isInstitutionOwner
public boolean isInstitutionOwner()
Gets whether user manages an institution- Returns:
- whether user manages an institution
-
isAdmin
public boolean isAdmin()
Gets whether user is an administrator- Returns:
- whether user is an administrator
-
equals
public boolean equals(Object o)
Gets whether two instances represents the same user
-
-