Class AttributeMappings
java.lang.Object
tech.prodigio.core.libcoreservices.extension.AttributeMappings
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectgetAttributeAsDataType(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
* LocalDateTimeprotected com.fasterxml.jackson.databind.JsonNodegetJsonAttribute(com.fasterxml.jackson.databind.JsonNode jsonNode, String path) Find embedded jsonNode, can be used to find json objects in any depth levelprotected ObjectmapAttribute(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 dataTypeprotected 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 itprotected booleanmapToBooleanAttribute(com.fasterxml.jackson.databind.JsonNode jsonNode, String path) protected IntegermapToIntegerAttribute(com.fasterxml.jackson.databind.JsonNode jsonNode, String path) protected LocalDatemapToLocalDateAttribute(com.fasterxml.jackson.databind.JsonNode jsonNode, String path) protected LocalDateTimemapToLocalDateTimeAttribute(com.fasterxml.jackson.databind.JsonNode jsonNode, String path) protected LocalTimemapToLocalTimeAttribute(com.fasterxml.jackson.databind.JsonNode jsonNode, String path) protected LongmapToLongAttribute(com.fasterxml.jackson.databind.JsonNode jsonNode, String path) protected StringmapToStringAttribute(com.fasterxml.jackson.databind.JsonNode jsonNode, String path)
-
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- jsonNodepath- path to find attribute inside jsonNodedataType- 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- jsonNodepath- 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- jsonNodedataType- 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- jsonNodepath- path to find object- Returns:
- JsonNode
-
mapToLocalDateAttribute
-
mapToLocalDateTimeAttribute
protected LocalDateTime mapToLocalDateTimeAttribute(com.fasterxml.jackson.databind.JsonNode jsonNode, String path) -
mapToStringAttribute
-
mapToBooleanAttribute
protected boolean mapToBooleanAttribute(com.fasterxml.jackson.databind.JsonNode jsonNode, String path) -
mapToLongAttribute
-
mapToIntegerAttribute
-
mapToLocalTimeAttribute
-