Package org.gcube.common.software.utils
Class Utils
java.lang.Object
org.gcube.common.software.utils.Utils
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDateTime Pattern to be used to serialize Datesprotected static com.fasterxml.jackson.databind.ObjectMapper -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetDateAsString(Date date) static com.fasterxml.jackson.databind.ObjectMapperstatic com.fasterxml.jackson.databind.JsonNodemerge(com.fasterxml.jackson.databind.JsonNode node1, com.fasterxml.jackson.databind.JsonNode node2) Clone node1 and merge all the properties contained in node2 into the cloned JsonNode.static StringreplaceVariable(String variableName, String replace, String s)
-
Field Details
-
DATETIME_PATTERN
DateTime Pattern to be used to serialize Dates- See Also:
-
objectMapper
protected static com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
-
Constructor Details
-
Utils
public Utils()
-
-
Method Details
-
getDateAsString
-
getObjectMapper
public static com.fasterxml.jackson.databind.ObjectMapper getObjectMapper() -
replaceVariable
-
merge
public static com.fasterxml.jackson.databind.JsonNode merge(com.fasterxml.jackson.databind.JsonNode node1, com.fasterxml.jackson.databind.JsonNode node2) Clone node1 and merge all the properties contained in node2 into the cloned JsonNode. In other words, the properties contained in node2 will replace/add the properties contained in the clone of node1. Both node1 and node2 are not modified.- Parameters:
node1- contains the properties to be merged with the properties contained in node2.node2- contains the properties will replace/add the properties in the clone of node1.- Returns:
- a new JsonNode containing the merged properties.
-