Class Token

  • All Implemented Interfaces:
    java.io.Serializable

    public class Token
    extends java.lang.Object
    implements java.io.Serializable
    Represents an OAuth token (either request or access token) and its secret
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Token​(java.lang.String token, java.lang.String secret)
      Default constructor
      Token​(java.lang.String token, java.lang.String secret, java.lang.String rawResponse)  
    • Constructor Detail

      • Token

        public Token​(java.lang.String token,
                     java.lang.String secret)
        Default constructor
        Parameters:
        token - token value. Can't be null.
        secret - token secret. Can't be null.
      • Token

        public Token​(java.lang.String token,
                     java.lang.String secret,
                     java.lang.String rawResponse)
    • Method Detail

      • getToken

        public java.lang.String getToken()
      • getSecret

        public java.lang.String getSecret()
      • getRawResponse

        public java.lang.String getRawResponse()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • isEmpty

        public boolean isEmpty()
        Returns true if the token is empty (token = "", secret = "")
      • empty

        public static Token empty()
        Factory method that returns an empty token (token = "", secret = ""). Useful for two legged OAuth.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object