Class TokenIdentity

java.lang.Object
dev.orne.beans.TokenIdentity
All Implemented Interfaces:
Identity, Serializable

@API(status=STABLE, since="0.1") public class TokenIdentity extends Object implements Identity
Implementation of Identity for identities of unknown format restored from identity tokens.
Since:
0.1
Version:
1.0, 2020-05
Author:
(w) Iker Hernaez
See Also:
  • Constructor Details

    • TokenIdentity

      public TokenIdentity(@NotNull @NotNull String token)
      Creates a new instance.
      Parameters:
      token - The identity token
  • Method Details

    • getIdentityToken

      @NotBlank public @NotBlank String getIdentityToken()
      Returns the identity token. This token must be unique among non equal instances of the same type of tokens.
      Specified by:
      getIdentityToken in interface Identity
      Returns:
      The identity token
    • hashCode

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

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

      public String toString()
      Overrides:
      toString in class Object
    • fromToken

      public static TokenIdentity fromToken(String token)
      Creates the TokenIdentity from the identity token in String form. If the token is null or empty returns null.
      Parameters:
      token - The identity token
      Returns:
      The created TokenIdentity instance, or null if invalid token