Class DeserializationUtil


  • public final class DeserializationUtil
    extends Object
    Common utilities for working with JSON
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static com.fasterxml.jackson.databind.JsonNode getFirstValue​(com.fasterxml.jackson.core.TreeNode filterNode)
      Get the first value in a node
      static Stream<com.fasterxml.jackson.databind.JsonNode> getNodeStream​(com.fasterxml.jackson.core.TreeNode filterNode)
      Gets a stream of the child nodes if filterNode is array, otherwise returns a stream containing only the filterNode
      static boolean isDate​(com.fasterxml.jackson.databind.node.TextNode text)
      Determines if the date field will successfully parse
    • Method Detail

      • getFirstValue

        public static com.fasterxml.jackson.databind.JsonNode getFirstValue​(com.fasterxml.jackson.core.TreeNode filterNode)
        Get the first value in a node
        Parameters:
        filterNode - If this node is an array, get the first value, otherwise return this node
        Returns:
        The JsonNode or the first element in the array
      • getNodeStream

        public static Stream<com.fasterxml.jackson.databind.JsonNode> getNodeStream​(com.fasterxml.jackson.core.TreeNode filterNode)
        Gets a stream of the child nodes if filterNode is array, otherwise returns a stream containing only the filterNode
        Parameters:
        filterNode - The node to stream
        Returns:
        The filterNode if its not an array, other the filter of the array
      • isDate

        public static boolean isDate​(com.fasterxml.jackson.databind.node.TextNode text)
        Determines if the date field will successfully parse
        Parameters:
        text - The TextNode that contains the date
        Returns:
        true if the TextNode represents a date, otherwise falue