Class StoredTokenPair

  • All Implemented Interfaces:
    StoredSecret

    public final class StoredTokenPair
    extends Object
    implements StoredSecret
    A security token pair, combining access and refresh tokens.
    • Constructor Detail

      • StoredTokenPair

        public StoredTokenPair​(StoredToken accessToken,
                               StoredToken refreshToken)
        Creates a new StoredTokenPair from raw access and refresh token data.
        Parameters:
        accessToken - The base64 encoded value of the access token's raw data
        refreshToken - The base64 encoded value of the refresh token's raw data
      • StoredTokenPair

        public StoredTokenPair​(char[] accessToken,
                               char[] refreshToken,
                               Map<String,​String> parameters)
        Creates a new StoredTokenPair from raw access and refresh token data.
        Parameters:
        accessToken - The base64 encoded value of the access token's raw data
        refreshToken - The base64 encoded value of the refresh token's raw data
        parameters - Map with additional parameters for the token pair
      • StoredTokenPair

        public StoredTokenPair​(char[] accessToken,
                               char[] refreshToken)
        Creates a new StoredTokenPair from raw access and refresh token data.
        Parameters:
        accessToken - The base64 encoded value of the access token's raw data
        refreshToken - The base64 encoded value of the refresh token's raw data
    • Method Detail

      • getAccessToken

        public StoredToken getAccessToken()
        Access token, used to grant access to resources.
        Returns:
        access token
      • getRefreshToken

        public StoredToken getRefreshToken()
        Refresh token, used to grant new access tokens.
        Returns:
        refresh token
      • clear

        public void clear()
        Clear the token pair value.
        Specified by:
        clear in interface StoredSecret
      • equals

        public boolean equals​(Object o)
        Compares an object to this.
        Overrides:
        equals in class Object
        Parameters:
        o - The object to compare.
        Returns:
        True if equal; false otherwise
      • hashCode

        public int hashCode()
        Gets a hash code based on the contents of the StoredTokenPair.
        Overrides:
        hashCode in class Object
        Returns:
        32-bit hash code.