Class Utils

java.lang.Object
org.gcube.common.software.utils.Utils

public class Utils extends Object
Author:
Luca Frosini (ISTI - CNR)
  • Field Details

    • DATETIME_PATTERN

      public static final String 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

      public static String getDateAsString(Date date)
    • getObjectMapper

      public static com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
    • replaceVariable

      public static String replaceVariable(String variableName, String replace, String s)
    • 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.