java.lang.Object | |
↳ | com.urbanairship.util.UAStringUtil |
A class containing utility methods related to strings.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
UAStringUtil() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static byte[] |
base64Decode(String encoded)
Base64 decodes a string.
| ||||||||||
static String |
base64DecodedString(String encoded)
Generates a base 64 decoded string.
| ||||||||||
static String |
byteToHex(byte[] bytes)
Converts the bytes into a hex string.
| ||||||||||
static boolean |
equals(String firstString, String secondString)
Checks if the strings are equal.
| ||||||||||
static String |
generateSignedToken(String secret, List<String> values)
Generates a base64 encoded HmacSHA256 signed value.
| ||||||||||
static boolean |
isEmpty(String stringToCheck)
Checks if the string is empty.
| ||||||||||
static String |
join(Collection<String> c, String delimiter)
Append a collection of strings and delimiter.
| ||||||||||
static String | namedStringResource(Context context, String name, String defaultValue) | ||||||||||
static String | nullIfEmpty(String value) | ||||||||||
static String |
repeat(String repeater, int times, String separator)
Builds a string.
| ||||||||||
static String |
sha256(String value)
Returns the sha256 hex string for a given string.
| ||||||||||
static byte[] |
sha256Digest(String value)
Generates the sha256 digest for a given string.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Base64 decodes a string.
encoded | The base64 encoded string. |
---|
Generates a base 64 decoded string.
encoded | The encoded value. |
---|
Converts the bytes into a hex string.
bytes | The byte array. |
---|
Checks if the strings are equal.
firstString | The first string. |
---|---|
secondString | The second string. |
true
if the strings are equal, false
otherwise.
Generates a base64 encoded HmacSHA256 signed value.
secret | The secret |
---|---|
values | A list of values that will be concatenated by ":" |
Checks if the string is empty.
stringToCheck | The string to check. |
---|
true
if the string is null, false
otherwise.
Append a collection of strings and delimiter.
c | A collection of strings. |
---|---|
delimiter | A delimiter string. |
Builds a string.
repeater | The string to build. |
---|---|
times | The number of times to append the string. |
separator | The separator string. |
Returns the sha256 hex string for a given string.
value | The value. |
---|
Generates the sha256 digest for a given string.
value | The string. |
---|