Class User


  • public class User
    extends Object
    Model of a user record, including roles.
    Author:
    Robert Fromont robert@fromont.net.nz
    • Constructor Detail

      • User

        public User()
        Default constructor.
      • User

        public User​(javax.json.JsonObject json)
        Constructor from JSON.
        Parameters:
        json - A JSON representation of the object to construct.
    • Method Detail

      • getUser

        public String getUser()
        Getter for user: User ID.
        Returns:
        User ID.
      • setUser

        public User setUser​(String newUser)
        Setter for user: User ID.
        Parameters:
        newUser - User ID.
        Returns:
        A reference to this object, so that setters can be chained.
      • getEmail

        public String getEmail()
        Getter for email: Email address.
        Returns:
        Email address.
      • setEmail

        public User setEmail​(String newEmail)
        Setter for email: Email address.
        Parameters:
        newEmail - Email address.
        Returns:
        A reference to this object, so that setters can be chained.
      • getResetPassword

        public Boolean getResetPassword()
        Getter for resetPassword: Whether the user must reset their password when they next log in.
        Returns:
        Whether the user must reset their password when they next log in.
      • setResetPassword

        public User setResetPassword​(Boolean newResetPassword)
        Setter for resetPassword: Whether the user must reset their password when they next log in.
        Parameters:
        newResetPassword - Whether the user must reset their password when they next log in.
        Returns:
        A reference to this object, so that setters can be chained.
      • getRoles

        public String[] getRoles()
        Getter for roles: Roles or groups the user belongs to.
        Returns:
        Roles or groups the user belongs to.
      • setRoles

        public User setRoles​(String[] newRoles)
        Setter for roles: Roles or groups the user belongs to.
        Parameters:
        newRoles - Roles or groups the user belongs to.
        Returns:
        A reference to this object, so that setters can be chained.
      • toJson

        public javax.json.JsonObject toJson()
        Serializes the object to JSON.
        Returns:
        A JSON serialization of the object.