Package org.apache.cassandra.utils
Class JsonUtils
java.lang.Object
org.apache.cassandra.utils.JsonUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.fasterxml.jackson.databind.ObjectMapperstatic final com.fasterxml.jackson.databind.ObjectWriter -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectdecodeJson(byte[] json) static ObjectdecodeJson(String json) static <T> TdeserializeFromJsonBytes(Class<T> tClass, byte[] bytes) static <T> TdeserializeFromJsonFile(Class<T> tClass, File file) fromJsonList(byte[] bytes) fromJsonList(String json) fromJsonMap(byte[] bytes) fromJsonMap(String json) static voidhandleCaseSensitivity(Map<String, Object> valueMap) Handles unquoting and case-insensitivity in map keys.static StringQuotes string contents using standard JSON quoting.static voidserializeToJsonFile(Object object, File outputFile) static voidserializeToJsonFileAtomic(Object object, File outputFile) static byte[]writeAsJsonBytes(Object value) static StringwriteAsJsonString(Object value) static StringwriteAsPrettyJsonString(Object value)
-
Field Details
-
JSON_OBJECT_MAPPER
public static final com.fasterxml.jackson.databind.ObjectMapper JSON_OBJECT_MAPPER -
JSON_OBJECT_PRETTY_WRITER
public static final com.fasterxml.jackson.databind.ObjectWriter JSON_OBJECT_PRETTY_WRITER
-
-
Method Details
-
quoteAsJsonString
Quotes string contents using standard JSON quoting. -
decodeJson
-
decodeJson
-
writeAsJsonBytes
-
writeAsJsonString
-
writeAsPrettyJsonString
- Throws:
MarshalException
-
fromJsonMap
-
fromJsonMap
-
fromJsonList
-
fromJsonList
-
serializeToJsonFile
- Throws:
IOException
-
serializeToJsonFileAtomic
- Throws:
IOException
-
deserializeFromJsonFile
- Throws:
IOException
-
deserializeFromJsonBytes
- Throws:
IOException
-
handleCaseSensitivity
Handles unquoting and case-insensitivity in map keys.
-