|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sponsorpay.sdk.android.UrlBuilder
public class UrlBuilder
Contains utility methods to build URLs used to access the SponsorPay's back-end API.
| Field Summary | |
|---|---|
private static java.lang.String |
ANDROID_ID_KEY
The Android ID key for encoding the corresponding URL parameter. |
private static java.lang.String |
APPID_KEY
The App ID key for encoding the corresponding URL parameter. |
private static java.lang.String |
LANGUAGE_KEY
The default language setting key for encoding the corresponding URL parameter. |
private static java.lang.String |
OS_VERSION_KEY
The OS version key for encoding the corresponding URL parameter. |
private static java.lang.String |
PHONE_VERSION_KEY
The phone model key for encoding the corresponding URL parameter. |
private static java.lang.String |
SDK_RELEASE_VERSION_KEY
The SDK release version key for encoding the corresponding URL parameter. |
private static java.lang.String |
UDID_KEY
The unique device ID (for url-encoding). |
static java.lang.String |
URL_PARAM_ALLOW_CAMPAIGN_KEY
|
static java.lang.String |
URL_PARAM_CURRENCY_NAME_KEY
|
static java.lang.String |
URL_PARAM_OFFSET_KEY
|
private static java.lang.String |
URL_PARAM_SIGNATURE
Request signature parameter key. |
static java.lang.String |
URL_PARAM_VALUE_ON
|
private static java.lang.String |
USERID_KEY
The user id key for encoding the corresponding URL parameter. |
private static java.lang.String |
WIFI_MAC_ADDRESS_KEY
The WiFi MAC Address ID key for encoding the corresponding URL parameter. |
| Constructor Summary | |
|---|---|
UrlBuilder()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
buildUrl(java.lang.String resourceUrl,
HostInfo hostInfo,
java.util.Map<java.lang.String,java.lang.String> extraKeysValues)
Builds a String URL with information gathered from the device and the specified parameters. |
static java.lang.String |
buildUrl(java.lang.String resourceUrl,
java.lang.String userId,
HostInfo hostInfo,
java.util.Map<java.lang.String,java.lang.String> extraKeysValues)
Builds a String URL with information gathered from the device and the specified parameters. |
static java.lang.String |
buildUrl(java.lang.String resourceUrl,
java.lang.String userId,
HostInfo hostInfo,
java.util.Map<java.lang.String,java.lang.String> extraKeysValues,
java.lang.String secretKey)
Builds a String URL with information gathered from the device and the specified parameters. |
static java.util.Map<java.lang.String,java.lang.String> |
mapKeysToValues(java.lang.String[] keys,
java.lang.String[] values)
Constructs a Map of key / value parameters given an array of keys and an array of values. |
static void |
validateKeyValueParams(java.util.Map<java.lang.String,java.lang.String> kvParams)
Checks that the passed Map of key/value parameters doesn't contain empty or null keys or values. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.lang.String UDID_KEY
private static final java.lang.String USERID_KEY
private static final java.lang.String APPID_KEY
private static final java.lang.String OS_VERSION_KEY
private static final java.lang.String PHONE_VERSION_KEY
private static final java.lang.String LANGUAGE_KEY
private static final java.lang.String SDK_RELEASE_VERSION_KEY
private static final java.lang.String ANDROID_ID_KEY
private static final java.lang.String WIFI_MAC_ADDRESS_KEY
private static final java.lang.String URL_PARAM_SIGNATURE
public static final java.lang.String URL_PARAM_ALLOW_CAMPAIGN_KEY
public static final java.lang.String URL_PARAM_VALUE_ON
public static final java.lang.String URL_PARAM_OFFSET_KEY
public static final java.lang.String URL_PARAM_CURRENCY_NAME_KEY
| Constructor Detail |
|---|
public UrlBuilder()
| Method Detail |
|---|
public static java.lang.String buildUrl(java.lang.String resourceUrl,
java.lang.String userId,
HostInfo hostInfo,
java.util.Map<java.lang.String,java.lang.String> extraKeysValues)
resourceUrl - The base for the URL to be built and returned, including schema and host.userId - The user id parameter to encode in the result URL. It can be left to null and no
user ID parameter key will be included in the request parameters.hostInfo - A HostInfo instance used to retrieve data about the application id and the
host device.extraKeysValues - A map of extra key/value pairs to add to the result URL.
public static java.lang.String buildUrl(java.lang.String resourceUrl,
HostInfo hostInfo,
java.util.Map<java.lang.String,java.lang.String> extraKeysValues)
resourceUrl - The base for the URL to be built and returned, including schema and host.hostInfo - A HostInfo instance used to retrieve data about the application id and the
host device.extraKeysValues - A map of extra key/value pairs to add to the result URL.
public static java.lang.String buildUrl(java.lang.String resourceUrl,
java.lang.String userId,
HostInfo hostInfo,
java.util.Map<java.lang.String,java.lang.String> extraKeysValues,
java.lang.String secretKey)
resourceUrl - The base for the URL to be built and returned, including schema and host.userId - The user id parameter to encode in the result URL. It can be left to null and no
user ID parameter key will be included in the request parameters.hostInfo - A HostInfo instance used to retrieve data about the application id and the
host device.extraKeysValues - A map of extra key/value pairs to add to the result URL.secretKey - The publisher's secret token which will be used to sign the request. If left to
null the request will be sent unsigned.
public static void validateKeyValueParams(java.util.Map<java.lang.String,java.lang.String> kvParams)
IllegalArgumentException.
kvParams -
public static java.util.Map<java.lang.String,java.lang.String> mapKeysToValues(java.lang.String[] keys,
java.lang.String[] values)
IllegalArgumentException
will be triggered.
keys - An array of keysvalues - an array of values in the same order than the provided array of keys
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||