Class User

java.lang.Object
com.sanctionco.thunder.models.User

public class User extends Object
Represents a user, providing access to the user's email, password, and additional properties.
  • Constructor Details

    • User

      public User(Email email, String password, Map<String,​Object> properties)
      Constructs a new user with the given email, password, and additional properties.
      Parameters:
      email - the user's email. This is the user's primary key.
      password - the user's hashed (not plaintext) password
      properties - the map of additional user properties. If null, an empty map will be used.
  • Method Details

    • getEmail

      public Email getEmail()
    • getPassword

      public String getPassword()
    • getProperties

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

      public void setProperty(String name, Object value)
    • withTime

      public User withTime(long creationTime, long lastUpdateTime)
      Creates a new User instance with the same properties as the current one, adding additional creationTime and lastUpdatedTime properties.
      Parameters:
      creationTime - the creation time of the user
      lastUpdateTime - the last updated time of the user
      Returns:
      a new User instance with the two properties added
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object