com.paypal.base.rest
Class RESTUtil

java.lang.Object
  extended by com.paypal.base.rest.RESTUtil

public final class RESTUtil
extends Object

RESTUtil acts as utility class used by REST API system

Author:
kjayakumar

Method Summary
static String formatURIPath(String pattern, Map<String,String> pathParameters)
          Formats the URI path for REST calls.
static String formatURIPath(String pattern, Map<String,String> pathParameters, Map<String,String> queryParameters)
          Formats the URI path for REST calls.
static String formatURIPath(String pattern, Object[] parameters)
          Formats the URI path for REST calls.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

formatURIPath

public static String formatURIPath(String pattern,
                                   Object[] parameters)
Formats the URI path for REST calls.

Parameters:
pattern - URI pattern with place holders for replacement strings
parameters - Replacement objects
Returns:
Formatted URI path

formatURIPath

public static String formatURIPath(String pattern,
                                   Map<String,String> pathParameters)
                            throws PayPalRESTException
Formats the URI path for REST calls. Replaces any occurrences of the form {name} in pattern with the corresponding value of key name in the passes Map

Parameters:
pattern - URI pattern with named place holders
pathParameters - Parameter Map
Returns:
Processed URI path
Throws:
PayPalRESTException

formatURIPath

public static String formatURIPath(String pattern,
                                   Map<String,String> pathParameters,
                                   Map<String,String> queryParameters)
                            throws PayPalRESTException
Formats the URI path for REST calls. Replaces any occurrences of the form {name} in pattern with the corresponding value of key name in the passes Map. Query parameters are appended to the end of the URI path

Parameters:
pattern - URI pattern with named place holders
pathParameters - Parameter Map
queryParameters - Query parameters Map
Returns:
Processed URI path
Throws:
PayPalRESTException


Copyright © 2015. All Rights Reserved.