Package net.gini.android
Class Utils
- java.lang.Object
-
- net.gini.android.Utils
-
public class Utils extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.nio.charset.Charset
CHARSET_UTF8
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T
checkNotNull(T reference)
Ensures that an object reference passed as a parameter to the calling method is not null.static java.lang.String
mapToUrlEncodedString(java.util.Map<java.lang.String,java.lang.String> data)
Creates an urlencoded string from the given data.
-
-
-
Method Detail
-
checkNotNull
public static <T> T checkNotNull(T reference)
Ensures that an object reference passed as a parameter to the calling method is not null.- Parameters:
reference
- an object reference- Returns:
- the non-null reference that was validated
- Throws:
java.lang.NullPointerException
- ifreference
is null
-
mapToUrlEncodedString
public static java.lang.String mapToUrlEncodedString(java.util.Map<java.lang.String,java.lang.String> data)
Creates an urlencoded string from the given data. The created string can be used as a query string or the request body of a x-www-form-urlencoded form.- Parameters:
data
- A map where the key is the name of the query parameter and the value is the parameter's value.- Returns:
- The urlencoded data.
-
-