public abstract class JsonNodeConvertingCodec<T> extends ConvertingCodec<JsonNode,T>
internalCodec, javaType| Modifier | Constructor and Description |
|---|---|
protected |
JsonNodeConvertingCodec(TypeCodec<T> targetCodec,
List<String> nullStrings) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
isNull(JsonNode node)
Whether the input is null.
|
protected boolean |
isNullOrEmpty(JsonNode node)
Whether the input is null or empty.
|
decode, encode, externalToInternal, format, getCqlType, getInternalCodec, getInternalJavaType, getJavaType, internalToExternal, parseprotected boolean isNull(JsonNode node)
This method should be used to inspect external inputs that are meant to be converted to textual CQL types only (text, varchar and ascii).
It always considers the empty string as NOT equivalent to NULL, unless the user clearly
specifies that the empty string is to be considered as NULL, through the
codec.nullStrings setting.
Do NOT use this method for non-textual CQL types; use isNullOrEmpty(JsonNode)
instead.
protected boolean isNullOrEmpty(JsonNode node)
This method should be used to inspect external inputs that are meant to be converted to non-textual CQL types only.
It always considers the empty string as equivalent to NULL, which is in compliance with the
documentation of codec.nullStrings: "Note that, regardless of this setting, DSBulk
will always convert empty strings to `null` if the target CQL type is not textual (i.e. not
text, varchar or ascii)."
Do NOT use this method for textual CQL types; use isNull(JsonNode) instead.
Copyright © 2017–2021 DataStax. All rights reserved.