Skip to content

Commit

Permalink
Added javadoc for Token
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo Fernandez committed May 10, 2010
1 parent 7bd0760 commit d057a33
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion src/main/java/org/scribe/oauth/Token.java
Expand Up @@ -16,7 +16,15 @@
package org.scribe.oauth;

import java.io.*;

/**
* This class represents an OAuth Token, which is formed by a token
* and a token_secret.
*
* This can be either a <em>Request Token</em> or an <em>Access Token</em>
*
* @author Pablo Fernandez
*
*/
public class Token implements Serializable {

private static final long serialVersionUID = -211981113194439605L;
Expand All @@ -25,10 +33,26 @@ public class Token implements Serializable {
private String secret;
private String rawString;

/**
* Default constructor
*
* @param OAuth Token
* @param OAuth Token Secret
*/
public Token(String token, String secret){
this(token, secret, "");
}

/**
* Equalizer Constructor
*
* This is used internally to also store the raw response you get from the request/access token request
* You should probably use the Default Constructor instead.
*
* @param OAuth Token
* @param OAuth Secret
* @param Raw Response
*/
public Token(String token, String secret, String rawString){
this.token = token;
this.secret = secret;
Expand All @@ -47,6 +71,9 @@ public String getRawString(){
return rawString;
}

/**
* Friendly representation of the Token. Do not depend on the format as it may change.
*/
public String toString(){
return String.format("oauth_token -> %s oauth_token_secret -> %s",token,secret);
}
Expand Down

0 comments on commit d057a33

Please sign in to comment.