public final class Utils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
STR_AND
String separators.
|
static String |
STR_COMMA |
static String |
STR_EQUALS |
| Modifier and Type | Method and Description |
|---|---|
static Map<String,String> |
buildMapFromResponse(String response)
Builds a
Map from a API response string containing a key and value separated by a
&. |
static <T> T |
createApiService(Class<T> apiInterface,
URL baseUrl,
Credentials credentials)
Creates an implementation of the API endpoints defined by the service interface.
|
static Map<String,String> |
getApiParameters(Object query)
Given a query object this method gets its API parameters.
|
public static final String STR_AND
public static final String STR_COMMA
public static final String STR_EQUALS
public static Map<String,String> buildMapFromResponse(String response)
Map from a API response string containing a key and value separated by a
&.response - Response string returned by the API.Map with key and value pair.public static <T> T createApiService(Class<T> apiInterface, URL baseUrl, Credentials credentials)
T - Class type of the API interface.apiInterface - API interface class.baseUrl - Domain URL where we want to point the API calls.credentials - Token credentials to call the API.public static Map<String,String> getApiParameters(Object query) throws IllegalAccessException
ApiField annotation.query - Query object.IllegalAccessException - Check convertField(Field, Object, Map) for more
information.Copyright © 2017. All rights reserved.