Class Account

java.lang.Object
com.codingchili.core.security.Account
All Implemented Interfaces:
Storable, io.vertx.core.shareddata.Shareable, Serializable, Cloneable, Comparable

public class Account extends Object implements Storable
Transfer object used for authentication from clients. Password is to be consumed once read.
See Also:
Serialized Form
  • Constructor Details

    • Account

      public Account()
    • Account

      public Account(String username, String password)
    • Account

      public Account(Account account)
  • Method Details

    • getUsername

      public String getUsername()
    • setUsername

      public Account setUsername(String username)
    • getPassword

      public String getPassword()
      prefer using getCharPassword over this, as this method creates a new copy in memory of the password. It is required for serialization purposes.
      Returns:
      a copy of the raw char array as a string.
    • setPassword

      public Account setPassword(String password)
    • getProperties

      public Map<String,​Object> getProperties()
    • setProperties

      public Account setProperties(Map<String,​Object> properties)
    • addProperty

      public Account addProperty(String key, Object value)
    • getEmail

      public String getEmail()
    • setEmail

      public Account setEmail(String email)
    • getId

      public String getId()
      Description copied from interface: Storable
      Get the id of the storable item, used as a key to the map api. This field is not included when serializing to JSON. When serializing to json the id must be kept separately.

      instead of implementing this method, to avoid duplicate values in values as keys; implement hashCode based on an unique attribute combination.

      Specified by:
      getId in interface Storable
      Returns:
      an id that is unique to this storable item.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object