Class 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 Detail

      • User

        public 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 interface org.springframework.security.core.userdetails.UserDetails
        Returns:
        all user's authorities
      • isAccountNonExpired

        public boolean isAccountNonExpired()
        indicates whether is account expired
        Specified by:
        isAccountNonExpired in interface org.springframework.security.core.userdetails.UserDetails
        Returns:
        whether is account expired
      • isAccountNonLocked

        public boolean isAccountNonLocked()
        indicates if the account is locked
        Specified by:
        isAccountNonLocked in interface org.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 interface org.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 interface org.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
        Overrides:
        equals in class Object
        Parameters:
        o - comparing user
        Returns:
        whether two instances represents the same user
      • hashCode

        public int hashCode()
        Gets the hash code
        Overrides:
        hashCode in class Object
        Returns:
        hash code