Class User

java.lang.Object
com.kheops.jmap.server.security.User
All Implemented Interfaces:
Serializable, Comparable<User>, Principal

public class User extends Object implements Principal, Serializable, Comparable<User>
This class represents a user. it implements Principal, Serializable Comparable
See Also:
  • Constructor Details

    • User

      public User(String username, String password)
      Constructor and Implementation
  • Method Details

    • getName

      public String getName()
      Returns the username of the current user.
      Specified by:
      getName in interface Principal
      Returns:
      the username.
    • getUser

      public String getUser()
      Gets the user
      Returns:
      user
    • toString

      public String toString()
      Overrides the toString method
      Specified by:
      toString in interface Principal
      Overrides:
      toString in class Object
      Returns:
      a String with containing the user name
    • getPassword

      public String getPassword()
      Gets the password
      Returns:
      password
    • getFullName

      public String getFullName()
      Gets the full name
      Returns:
      fullname
    • getEmailAddress

      public String getEmailAddress()
      Gets the email address
      Returns:
      emailAddress
    • getUserInfo

      public UserInfo getUserInfo()
    • setFullName

      public void setFullName(String fullName)
      Sets the full name
    • setPassword

      public void setPassword(String password)
      Sets the password
    • setEmailAddress

      public void setEmailAddress(String emailAddress)
      Sets the email address
    • hashCode

      public int hashCode()
      This method gets hashcode of the user name plus a prefix indicating that it's a user (needed to differentiate it from a group with the same name)
      Specified by:
      hashCode in interface Principal
      Overrides:
      hashCode in class Object
      Returns:
      the corresponding hashcode value
    • equals

      public boolean equals(Object o)
      This method compares names of the user with that of the object instance passed as a paramater
      Specified by:
      equals in interface Principal
      Overrides:
      equals in class Object
      Parameters:
      o - the object instance to compare to
      Returns:
      true if the names are equals false otherwise
    • compareTo

      public int compareTo(User user)
      Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

      It overrides the compareTo from the Comparable interface

      Specified by:
      compareTo in interface Comparable<User>
      Parameters:
      user - the object that is compare to
      Returns:
      the corresponding integer value
      See Also:
    • isHidden

      public boolean isHidden()
      Returns whether this user should be hidden in lists.
      Returns:
      a boolean which defines if this user is hidden.
    • setHidden

      public void setHidden(boolean hidden)
      Sets whether this user should be hidden in lists.
      Parameters:
      hidden - a boolean which defines if this user is hidden.