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 class
Custom JSON deserializer for Column default value.static class
Custom JSON serializer for Column default value.static class
Custom JSON deserializer for ColumnPosition objects.static class
Custom JSON serializer for SortOrderDTO objects.static class
Custom JSON deserializer for DistributionDTO objects.static class
Custom JSON serializer for DistributionDTO objects.static class
Custom JSON deserializer for Index objects.static class
Custom JSON serializer for Index objects.static class
Custom JSON deserializer for NameIdentifier objects.static class
Custom JSON serializer for NameIdentifier objects.static class
Custom JSON deserializer for PartitionDTO objects.static class
Custom JSON serializer for PartitionDTO objects.static class
Custom JSON deserializer for Partitioning objects.static class
Custom JSON serializer for PartitionDTO objects.static class
Custom JSON deserializer for SortOrderDTO objects.static class
Custom JSON serializer for SortOrderDTO objects.static class
Custom JSON deserializer for StatisticValue objects.static class
Custom JSON serializer for StatisticValue objects.static class
Custom JSON deserializer for Gravitino Type objects.static class
Custom JSON serializer for Gravitino Type objects. -
Method Summary
Modifier and TypeMethodDescriptionstatic com.fasterxml.jackson.databind.ObjectMapper
Get the shared AnyFieldMapper instance for JSON serialization/deserialization.static int
Get an int value from a JSON node property.static long
Get a long value from a JSON node property.static String
Get a string value from a JSON node property.static com.fasterxml.jackson.databind.ObjectMapper
Returns a sharedObjectMapper
instance for JSON serialization/deserialization test.
-
Method Details
-
objectMapper
public static com.fasterxml.jackson.databind.ObjectMapper objectMapper()Returns a sharedObjectMapper
instance for JSON serialization/deserialization test.Note: This instance is intended for testing purposes only. For production use, obtain an
ObjectMapper
from the following providers:- Client side:
org.apache.gravitino.client.ObjectMapperProvider
- Server side:
org.apache.gravitino.server.web.ObjectMapperProvider
- Returns:
- the shared
ObjectMapper
instance 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.
-