public interface JsonValue
Implementations of this interface need to make sure parsing of the JSON is not done inside the event loop thread, used to process the data coming from the Redis server; otherwise larger JSON documents might cause performance degradation that spans across all threads using the driver.
JsonObject,
JsonArray,
RFC 8259 - The JavaScript Object Notation (JSON) Data
Interchange Format| Modifier and Type | Method and Description |
|---|---|
Boolean |
asBoolean() |
ByteBuffer |
asByteBuffer() |
JsonArray |
asJsonArray() |
JsonObject |
asJsonObject() |
Number |
asNumber() |
String |
asString() |
boolean |
isBoolean() |
boolean |
isJsonArray() |
boolean |
isJsonObject() |
boolean |
isNull() |
boolean |
isNumber() |
boolean |
isString() |
<T> T |
toObject(Class<T> type)
Given a
Class type, this method will attempt to convert the JSON value to the provided type. |
String |
toString()
Execute any
RedisCodec decoding and fetch the result. |
String toString()
RedisCodec decoding and fetch the result.ByteBuffer asByteBuffer()
ByteBufferboolean isJsonArray()
true if this JsonValue represents a JSON arrayJsonArray asJsonArray()
JsonArray representation of this JsonValue, null if this is not a JSON arrayisJsonArray()boolean isJsonObject()
true if this JsonValue represents a JSON objectJsonObject asJsonObject()
JsonObject representation of this JsonValue, null if this is not a JSON objectisJsonObject()boolean isString()
true if this JsonValue represents a JSON stringString asString()
String representation of this JsonValue, null if this is not a JSON stringisString()boolean isNumber()
true if this JsonValue represents a JSON numberNumber asNumber()
Number representation of this JsonValue, null if this is not a JSON numberisNumber()boolean isBoolean()
true if this JsonValue represents a JSON boolean valueBoolean asBoolean()
Boolean representation of this JsonValue, null if this is not a JSON boolean valueisNumber()boolean isNull()
true if this JsonValue represents the value of null<T> T toObject(Class<T> type)
Class type, this method will attempt to convert the JSON value to the provided type.RedisJsonException - if the provided type is not a valid JSON documentCopyright © 2025 lettuce.io. All rights reserved.