Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.paypal.core.rest;
 
 import java.util.UUID;

APIContext holds wire-level parameters for the API call. AccessToken is treated as a mandatory parameter. RequestId is generated if not supplied

Author(s):
kjayakumar
public class APIContext {

Access Token
	private String accessToken;

Request Id
	private String requestId;

APIContext

Parameters:
accessToken AccessToken required for the call.
	public APIContext(String accessToken) {
		if (accessToken == null || accessToken.length() <= 0) {
			throw new IllegalArgumentException("AccessToken cannot be null");
		}
		this. = accessToken;
	}

APIContext

Parameters:
accessToken AccessToken required for the call.
requestId Unique requestId required for the call.
	public APIContext(String accessTokenString requestId) {
		this(accessToken);
		if (requestId == null || requestId.length() <= 0) {
			throw new IllegalArgumentException("RequestId cannot be null");
		}
		this. = requestId;
	}

Returns the Access Token

Returns:
Access Token
	public String getAccessToken() {
		return ;
	}

Returns the unique requestId set during creation, if not available returns a generated one

Returns:
requestId
	public String getRequestId() {
		if ( == null || .length() <= 0) {
		}
		return ;
	}
New to GrepCode? Check out our FAQ X