public final class BsonUtils extends RuntimeException
| Modifier and Type | Field and Description |
|---|---|
static CodecRegistry |
DEFAULT_CODEC_REGISTRY
A basic codec registry which provides codecs for all BSON types, BSON documents, iterable
types, and maps.
|
| Constructor and Description |
|---|
BsonUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
parseValue(String json,
Class<T> valueClass)
Parses the provided extended JSON string and decodes it into a T value as specified by the
provided class type.
|
static <T> T |
parseValue(String json,
Class<T> valueClass,
CodecRegistry codecRegistry)
Parses the provided extended JSON string and decodes it into a T value as specified by the
provided class type.
|
static <T> T |
parseValue(String json,
Decoder<T> valueDecoder)
Parses the provided extended JSON string and decodes it into a T value as specified by the
provided
Decoder. |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic static final CodecRegistry DEFAULT_CODEC_REGISTRY
public static <T> T parseValue(String json, Decoder<T> valueDecoder)
Decoder.T - the type into which the JSON string is decoded.json - the JSON string to parse.valueDecoder - the Decoder to use to convert the BSON value into the type T.public static <T> T parseValue(String json, Class<T> valueClass)
CodecConfigurationException.T - the type into which the JSON string is decoded.json - the JSON string to parse.valueClass - the class that the JSON string should be decoded into.public static <T> T parseValue(String json, Class<T> valueClass, CodecRegistry codecRegistry)
CodecConfigurationException.T - the type into which the JSON string is decoded.json - the JSON string to parse.valueClass - the class that the JSON string should be decoded into.codecRegistry - the codec registry to use to find the codec for the provided class.