Package org.apache.gravitino.json
Class JsonUtils
java.lang.Object
org.apache.gravitino.json.JsonUtils
Utility class for working with JSON data.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCustom JSON deserializer for Column default value.static classCustom JSON serializer for Column default value.static classCustom JSON deserializer for ColumnPosition objects.static classCustom JSON serializer for SortOrderDTO objects.static classCustom JSON deserializer for DistributionDTO objects.static classCustom JSON serializer for DistributionDTO objects.static classCustom JSON deserializer for Index objects.static classCustom JSON serializer for Index objects.static classCustom JSON deserializer for NameIdentifier objects.static classCustom JSON serializer for NameIdentifier objects.static classCustom JSON deserializer for PartitionDTO objects.static classCustom JSON serializer for PartitionDTO objects.static classCustom JSON deserializer for Partitioning objects.static classCustom JSON serializer for PartitionDTO objects.static classCustom JSON deserializer for SortOrderDTO objects.static classCustom JSON serializer for SortOrderDTO objects.static classCustom JSON deserializer for StatisticValue objects.static classCustom JSON serializer for StatisticValue objects.static classCustom JSON deserializer for Gravitino Type objects.static classCustom JSON serializer for Gravitino Type objects. -
Method Summary
Modifier and TypeMethodDescriptionstatic com.fasterxml.jackson.databind.ObjectMapperGet the shared AnyFieldMapper instance for JSON serialization/deserialization.static intGet an int value from a JSON node property.static longGet a long value from a JSON node property.static StringGet a string value from a JSON node property.static com.fasterxml.jackson.databind.ObjectMapperReturns a sharedObjectMapperinstance for JSON serialization/deserialization test.
-
Method Details
-
objectMapper
public static com.fasterxml.jackson.databind.ObjectMapper objectMapper()Returns a sharedObjectMapperinstance for JSON serialization/deserialization test.Note: This instance is intended for testing purposes only. For production use, obtain an
ObjectMapperfrom the following providers:- Client side:
org.apache.gravitino.client.ObjectMapperProvider - Server side:
org.apache.gravitino.server.web.ObjectMapperProvider
- Returns:
- the shared
ObjectMapperinstance for testing.
- Client side:
-
anyFieldMapper
public static com.fasterxml.jackson.databind.ObjectMapper anyFieldMapper()Get the shared AnyFieldMapper instance for JSON serialization/deserialization.- Returns:
- The ObjectMapper instance.
-
getInt
Get an int value from a JSON node property.- Parameters:
property- The property name.node- The JSON node.- Returns:
- The int value.
-
getLong
Get a long value from a JSON node property.- Parameters:
property- The property name.node- The JSON node.- Returns:
- The long value.
-
getString
Get a string value from a JSON node property.- Parameters:
property- The property name.node- The JSON node.- Returns:
- The string value.
- Throws:
IllegalArgumentException- if the property is missing in the JSON node.
-