+ private static void putIfNonNull(ObjectNode property, String key, Number number) {
+ if (key != null && number != null) {
+ if (number instanceof Double) {
+ property.put(key, (Double) number);
+ } else if (number instanceof Float) {
+ property.put(key, (Float) number);
+ } else if (number instanceof Integer) {
+ property.put(key, (Integer) number);
+ } else if (number instanceof Short) {
+ property.put(key, (Short) number);
+ } else if (number instanceof Long) {
+ property.put(key, (Long) number);
+ }
+ }
+ }
+
+ private static void putIfNonNull(ObjectNode property, String key, String value) {
+ if (key != null && value != null) {
+ property.put(key, value);
+ }
+ }
+