Class BigIntegerIdentity

All Implemented Interfaces:
Identity, Serializable

@API(status=STABLE, since="0.1") public class BigIntegerIdentity extends AbstractSimpleIdentity<BigInteger>
Implementation for Identity for identities composed of a single inner BigInteger value.
Since:
0.1
Version:
1.0, 2020-05
Author:
(w) Iker Hernaez
See Also:
  • Constructor Details

    • BigIntegerIdentity

      @GeneratorMethod public BigIntegerIdentity(BigInteger value)
      Creates a new instance.
      Parameters:
      value - The identity value
    • BigIntegerIdentity

      public BigIntegerIdentity(@NotNull @NotNull BigIntegerIdentity copy)
      Copy constructor.
      Parameters:
      copy - The instance to copy
  • Method Details

    • fromIdentityToken

      @IdentityTokenResolver @NotNull public static @NotNull BigIntegerIdentity fromIdentityToken(@NotNull @NotNull String token) throws UnrecognizedIdentityTokenException
      Resolves the specified identity token to a valid BigIntegerIdentity.
      Parameters:
      token - The identity token
      Returns:
      The resolved identity token
      Throws:
      NullPointerException - If the identity token is null
      UnrecognizedIdentityTokenException - If the identity token is not a valid identity token or it doesn't start with the expected prefix
    • extractTokenValue

      public static BigInteger extractTokenValue(@NotNull @NotNull String prefix, @NotNull @NotNull String token)
      Extracts the BigInteger value of a token generated by BigIntegerIdentity.

      Note that the resulting value can be null. If a non-null value is expected useextractRequiredTokenValue(String, String).

      Parameters:
      prefix - The expected identity token prefix.
      token - The identity token.
      Returns:
      The extracted BigInteger value.
      Throws:
      NullPointerException - If the identity token is null
      UnrecognizedIdentityTokenException - If the identity token is not a valid simple identity token, if it doesn't start with the expected prefix or if the extracted value is not a valid big integer.
      See Also:
    • extractRequiredTokenValue

      @NotNull public static @NotNull BigInteger extractRequiredTokenValue(@NotNull @NotNull String prefix, @NotNull @NotNull String token)
      Extracts the BigInteger value of a token generated by BigIntegerIdentity.

      If the resulting value is null an exception is thrown.

      Parameters:
      prefix - The expected identity token prefix.
      token - The identity token.
      Returns:
      The extracted BigInteger value.
      Throws:
      NullPointerException - If the identity token is null
      UnrecognizedIdentityTokenException - If the identity token is not a valid simple identity token, if it doesn't start with the expected prefix, if the extracted value is null or if the extracted value is not a valid big integer.
      See Also: