Modifier | Constructor and Description |
---|---|
protected |
JsonUtils()
Only static members.
|
Modifier and Type | Method and Description |
---|---|
static void |
addIfNotNull(JsonObject jsonObject,
String propertyName,
Boolean propertyValue)
Adds Boolean property to the json object if it's not null.
|
static void |
addIfNotNull(JsonObject jsonObject,
String propertyName,
Date propertyValue)
Adds Date property to the json object if it's not null.
|
static void |
addIfNotNull(JsonObject jsonObject,
String propertyName,
Enum propertyValue)
Adds Enum property to the json object if it's not null.
|
static void |
addIfNotNull(JsonObject jsonObject,
String propertyName,
Integer propertyValue)
Adds Integer property to the json object if it's not null.
|
static void |
addIfNotNull(JsonObject jsonObject,
String propertyName,
Long propertyValue)
Adds Long property to the json object if it's not null.
|
static void |
addIfNotNull(JsonObject jsonObject,
String propertyName,
String propertyValue)
Adds String property to the json object if it's not null.
|
protected JsonUtils()
public static void addIfNotNull(JsonObject jsonObject, String propertyName, String propertyValue)
jsonObject
- json object that the key/value will be added to.propertyName
- name of the property in json (key).propertyValue
- value of the property.public static void addIfNotNull(JsonObject jsonObject, String propertyName, Boolean propertyValue)
jsonObject
- json object that the key/value will be added to.propertyName
- name of the property in json (key).propertyValue
- value of the property.public static void addIfNotNull(JsonObject jsonObject, String propertyName, Integer propertyValue)
jsonObject
- json object that the key/value will be added to.propertyName
- name of the property in json (key).propertyValue
- value of the property.public static void addIfNotNull(JsonObject jsonObject, String propertyName, Long propertyValue)
jsonObject
- json object that the key/value will be added to.propertyName
- name of the property in json (key).propertyValue
- value of the property.public static void addIfNotNull(JsonObject jsonObject, String propertyName, Enum propertyValue)
jsonObject
- json object that the key/value will be added to.propertyName
- name of the property in json (key).propertyValue
- value of the property.public static void addIfNotNull(JsonObject jsonObject, String propertyName, Date propertyValue)
jsonObject
- json object that the key/value will be added to.propertyName
- name of the property in json (key).propertyValue
- value of the property.