Class Utils


  • public class Utils
    extends Object
    Author:
    Luca Frosini (ISTI - CNR)
    • 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
    • Constructor Detail

      • Utils

        public Utils()
    • Method Detail

      • getDateAsString

        public static String getDateAsString​(Date date)
      • getObjectMapper

        public static org.gcube.com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
      • 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.