Class AttributeMappings

java.lang.Object
tech.prodigio.core.libcoreservices.extension.AttributeMappings

public class AttributeMappings extends Object
  • Constructor Details

    • AttributeMappings

      public AttributeMappings()
  • Method Details

    • mapAttribute

      protected Object mapAttribute(com.fasterxml.jackson.databind.JsonNode jsonNode, String path, String dataType)
      Searches for the attribute specified in the path and returns it with the data type specified in dataType

      > Support for the following data types:
      * String
      * Boolean
      * boolean
      * Integer
      * int
      * Long
      * Double
      * Float
      * BigDecimal
      * LocalDate
      * LocalDateTime

      Parameters:
      jsonNode - jsonNode
      path - path to find attribute inside jsonNode
      dataType - data type of the attribute to be returned
      Returns:
      Object
    • mapAttributeAsList

      protected List<com.fasterxml.jackson.databind.JsonNode> mapAttributeAsList(com.fasterxml.jackson.databind.JsonNode jsonNode, String path)
      Searches for the attribute specified in the path and returns as JsonNode list it
      Parameters:
      jsonNode - jsonNode
      path - path to find attribute inside jsonNode
      Returns:
      A list of JSON nodes
    • getAttributeAsDataType

      protected Object getAttributeAsDataType(com.fasterxml.jackson.databind.JsonNode data, String dataType)
      convert json node un object with data type specified Support for the following data types:
      * String
      * Boolean
      * boolean
      * Integer
      * int
      * Long
      * Double
      * Float
      * BigDecimal
      * LocalDate
      * LocalDateTime
      Parameters:
      data - jsonNode
      dataType - data type of the attribute to be returned
      Returns:
      dataType converter
    • getJsonAttribute

      protected com.fasterxml.jackson.databind.JsonNode getJsonAttribute(com.fasterxml.jackson.databind.JsonNode jsonNode, String path)
      Find embedded jsonNode, can be used to find json objects in any depth level
      Parameters:
      jsonNode - jsonNode
      path - path to find object
      Returns:
      JsonNode
    • mapToLocalDateAttribute

      protected LocalDate mapToLocalDateAttribute(com.fasterxml.jackson.databind.JsonNode jsonNode, String path)
    • mapToLocalDateTimeAttribute

      protected LocalDateTime mapToLocalDateTimeAttribute(com.fasterxml.jackson.databind.JsonNode jsonNode, String path)
    • mapToStringAttribute

      protected String mapToStringAttribute(com.fasterxml.jackson.databind.JsonNode jsonNode, String path)
    • mapToBooleanAttribute

      protected boolean mapToBooleanAttribute(com.fasterxml.jackson.databind.JsonNode jsonNode, String path)
    • mapToLongAttribute

      protected Long mapToLongAttribute(com.fasterxml.jackson.databind.JsonNode jsonNode, String path)
    • mapToIntegerAttribute

      protected Integer mapToIntegerAttribute(com.fasterxml.jackson.databind.JsonNode jsonNode, String path)
    • mapToLocalTimeAttribute

      protected LocalTime mapToLocalTimeAttribute(com.fasterxml.jackson.databind.JsonNode jsonNode, String path)