public class Tools extends Object
| Constructor and Description |
|---|
Tools() |
| Modifier and Type | Method and Description |
|---|---|
static void |
appendJsonAttribute(StringBuilder strBuilder,
String name,
String value,
Boolean isQuoted,
Boolean isLast)
Helper function to properly craft Json string of key-value pair
|
static boolean |
areEqual(Object a,
Object b)
Equality check for objects that accounts for null value comparisons.
|
static long |
getNumberValueFromJsonObject(javax.json.JsonObject jsonObject,
String key)
Helper function to get numeric value from a JsonObject
|
static String |
getValueFromJsonObject(javax.json.JsonObject jsonObject,
String key)
Helper function to get a value from the given JsonObject if the key name exists
|
static String |
getValueFromJsonString(javax.json.JsonString jsonString)
Helper function to get trim the leading and trailing parenthesis from a Json string if they exists
|
static String |
getValueStringByKey(Map map,
String keyName)
Helper function to get a value from the given Map if the key name exists
|
static Boolean |
isNullOrEmpty(String value)
Helper function to check if the input string is null or empty
|
static Boolean |
isNullOrWhiteSpace(String value)
Helper function to check if the input string is null or contains only whitespace(s)
|
public static Boolean isNullOrEmpty(String value)
value - The string to checkpublic static Boolean isNullOrWhiteSpace(String value)
value - The string to checkpublic static String getValueStringByKey(Map map, String keyName)
map - The Map object to get the value fromkeyName - The name of the keypublic static String getValueFromJsonObject(javax.json.JsonObject jsonObject, String key)
jsonObject - The JsonObject object to get the value fromkey - The name of the keypublic static String getValueFromJsonString(javax.json.JsonString jsonString)
jsonString - The JsonString to trimpublic static long getNumberValueFromJsonObject(javax.json.JsonObject jsonObject,
String key)
jsonObject - The JsonObject object to get the value fromkey - The name of the keypublic static void appendJsonAttribute(StringBuilder strBuilder, String name, String value, Boolean isQuoted, Boolean isLast)
strBuilder - The StringBuilder to work onname - The name of the keyvalue - The value of the keyisQuoted - If true leading and trailing quotes will be addedisLast - If false trailing comma will addedpublic static boolean areEqual(Object a, Object b)
a - the first objectb - the seconds objectCopyright © 2019. All rights reserved.