public class ParseUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
REQUEST_TIMEOUT |
| Modifier and Type | Method and Description |
|---|---|
static Boolean |
parseBooleanFromJson(String response,
String... path)
Parses boolean value out of the given field in a JSON response.
|
static Boolean |
parseContainsStringCaseInsensitive(String response,
String trueString,
String falseString)
Checks whether a given response contains the specified string (found/not found), case insensitive.
|
static Boolean |
parseIsStringCaseInsensitive(String response,
String trueString,
String falseString)
Checks whether a given response is equal to the specified string, case insensitive.
|
static Boolean |
parseIsYesNoCaseInsensitive(String response)
Checks whether the response is yes or no.
|
static Boolean |
parseRef(String response)
Checks whether the response is "ref", i.e.
|
static Boolean |
parseStartsWithStringCaseInsensitive(String response,
String trueString,
String falseString)
Checks whether a given response starts with the specified string, case insensitive.
|
static Boolean |
parseStartsWithYesNoCaseInsensitive(String response)
Checks whether the response starts with yes or no.
|
static String |
parseStringFromJson(String response,
String... path)
Parses string value out of the given field in a JSON response.
|
static Boolean |
parseYesNoFromJson(String response,
String... path)
Parses yes/no value out of the given field in a JSON response, case-insensitive.
|
public static final int REQUEST_TIMEOUT
public static Boolean parseContainsStringCaseInsensitive(String response, String trueString, String falseString)
response - responsetrueString - string reporting a positive query resultfalseString - string reporting a negative query resultpublic static Boolean parseStartsWithStringCaseInsensitive(String response, String trueString, String falseString)
response - responsetrueString - string reporting a positive query resultfalseString - string reporting a negative query resultpublic static Boolean parseIsStringCaseInsensitive(String response, String trueString, String falseString)
response - responsetrueString - string reporting a positive query resultfalseString - string reporting a negative query resultpublic static Boolean parseStartsWithYesNoCaseInsensitive(String response)
response - responsepublic static Boolean parseIsYesNoCaseInsensitive(String response)
response - responsepublic static Boolean parseRef(String response)
response - responsepublic static Boolean parseBooleanFromJson(String response, String... path)
response - response in JSON formatpath - list of JSON keys determining the path to the searched valuepublic static String parseStringFromJson(String response, String... path)
response - response in JSON formatpath - list of JSON keys determining the path to the searched valueCopyright © 2016 DNAstack. All rights reserved.