Class UsernamePasswordCredentials

java.lang.Object
one.jpro.platform.auth.core.basic.UsernamePasswordCredentials
All Implemented Interfaces:
Credentials

public class UsernamePasswordCredentials extends Object implements Credentials
Username and password credentials holder.
  • Property Details

  • Constructor Details

    • UsernamePasswordCredentials

      public UsernamePasswordCredentials()
      Default constructor.
    • UsernamePasswordCredentials

      public UsernamePasswordCredentials(@NotNull @NotNull String username, @NotNull @NotNull String password)
      Constructor with username and password.
      Parameters:
      username - the user's name
      password - the user's password
  • Method Details

    • getUsername

      @Nullable public @Nullable String getUsername()
      Gets the value of the username property.
      Property description:
      Returns:
      the value of the username property
      See Also:
    • setUsername

      public void setUsername(@NotNull @NotNull String username)
      Sets the value of the username property.
      Property description:
      Parameters:
      username - the value for the username property
      See Also:
    • usernameProperty

      @NotNull public final @NotNull javafx.beans.property.StringProperty usernameProperty()
      Returns:
      the username property
      See Also:
    • getPassword

      @Nullable public @Nullable String getPassword()
      Gets the value of the password property.
      Property description:
      Returns:
      the value of the password property
      See Also:
    • setPassword

      public final void setPassword(@NotNull @NotNull String password)
      Sets the value of the password property.
      Property description:
      Parameters:
      password - the value for the password property
      See Also:
    • passwordProperty

      @NotNull public final @NotNull javafx.beans.property.StringProperty passwordProperty()
      Returns:
      the password property
      See Also:
    • validate

      public <V> void validate(V arg) throws CredentialValidationException
      Description copied from interface: Credentials
      Implementors should override this method to perform validation. An argument is allowed to allow custom validation.
      Specified by:
      validate in interface Credentials
      Type Parameters:
      V - the generic type of the argument
      Parameters:
      arg - optional argument or null.
      Throws:
      CredentialValidationException - when the validation fails
    • equals

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

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

      public String toHttpAuthorization()
      Description copied from interface: Credentials
      Encodes this credential as an HTTP Authorization https://tools.ietf.org/html/rfc7235.
      Specified by:
      toHttpAuthorization in interface Credentials
      Returns:
      HTTP header including scheme.
    • toJSON

      public org.json.JSONObject toJSON()
      Description copied from interface: Credentials
      Convert the credential information to JSON format.
      Specified by:
      toJSON in interface Credentials
      Returns:
      a JSON object.