Package org.gcube.common.software.utils
Class Utils
- java.lang.Object
-
- org.gcube.common.software.utils.Utils
-
public class Utils extends Object
- Author:
- Luca Frosini (ISTI - CNR)
-
-
Field Summary
Fields Modifier and Type Field Description static StringDATETIME_PATTERNDateTime Pattern to be used to serialize Datesprotected static org.gcube.com.fasterxml.jackson.databind.ObjectMapperobjectMapper
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetDateAsString(Date date)static org.gcube.com.fasterxml.jackson.databind.ObjectMappergetObjectMapper()static org.gcube.com.fasterxml.jackson.databind.JsonNodemerge(org.gcube.com.fasterxml.jackson.databind.JsonNode node1, org.gcube.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 Detail
-
DATETIME_PATTERN
public static final String DATETIME_PATTERN
DateTime Pattern to be used to serialize Dates- See Also:
- Constant Field Values
-
objectMapper
protected static org.gcube.com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
-
Method Detail
-
getObjectMapper
public static org.gcube.com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
-
replaceVariable
public static String replaceVariable(String variableName, String replace, String s)
-
merge
public static org.gcube.com.fasterxml.jackson.databind.JsonNode merge(org.gcube.com.fasterxml.jackson.databind.JsonNode node1, org.gcube.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.
-
-