public class JSONCoercibleType extends java.lang.Object implements cascading.nested.core.NestedCoercibleType<JsonNode,ArrayNode>, cascading.tuple.type.SerializableType
NestedCoercibleType that provides support for JSON object types.
Supported values will be maintained as a JsonNode canonical type within the Tuple.
Note that canonical(Object) will always attempt to parse a String value to a new JsonNode.
If the parse fails, it will return a TextNode instance wrapping the
String value.
Note the default instance (@link TYPE), sets the DeserializationFeature.FAIL_ON_READING_DUP_TREE_KEY
Jackson property.
See the NestedCoercibleType.node(Object).
| Modifier and Type | Field and Description |
|---|---|
static JSONCoercibleType |
TYPE |
| Constructor and Description |
|---|
JSONCoercibleType(ObjectMapper mapper)
Instantiates a new Json coercible type with the given
ObjectMapper instance. |
| Modifier and Type | Method and Description |
|---|---|
JsonNode |
canonical(java.lang.Object value) |
<Coerce> Coerce |
coerce(java.lang.Object value,
java.lang.reflect.Type to) |
JsonNode |
deepCopy(JsonNode jsonNode) |
boolean |
equals(java.lang.Object object) |
<T> cascading.tuple.type.ToCanonical<T,JsonNode> |
from(java.lang.reflect.Type from) |
java.lang.Class<JsonNode> |
getCanonicalType() |
heretical.pointer.path.NestedPointerCompiler<JsonNode,ArrayNode> |
getNestedPointerCompiler() |
java.lang.Class |
getSerializer(java.lang.Class base) |
int |
hashCode() |
protected <T> T |
ifNull(JsonNode node,
java.util.function.Function<JsonNode,T> function) |
JsonNode |
newRoot() |
<T> cascading.tuple.type.CoercionFrom<JsonNode,T> |
to(java.lang.reflect.Type to) |
java.lang.String |
toString() |
public static final JSONCoercibleType TYPE
public JSONCoercibleType(ObjectMapper mapper)
ObjectMapper instance.
Use this constructor in order to leverage Module instances.
Note the default instance (@link TYPE), sets the DeserializationFeature.FAIL_ON_READING_DUP_TREE_KEY
Jackson property.
mapper - the mapperpublic java.lang.Class<JsonNode> getCanonicalType()
getCanonicalType in interface cascading.tuple.type.CoercibleType<JsonNode>public <T> cascading.tuple.type.ToCanonical<T,JsonNode> from(java.lang.reflect.Type from)
from in interface cascading.tuple.type.CoercibleType<JsonNode>public JsonNode canonical(java.lang.Object value)
canonical in interface cascading.tuple.type.CoercibleType<JsonNode>public <T> cascading.tuple.type.CoercionFrom<JsonNode,T> to(java.lang.reflect.Type to)
to in interface cascading.tuple.type.CoercibleType<JsonNode>public <Coerce> Coerce coerce(java.lang.Object value, java.lang.reflect.Type to)
coerce in interface cascading.tuple.type.CoercibleType<JsonNode>public heretical.pointer.path.NestedPointerCompiler<JsonNode,ArrayNode> getNestedPointerCompiler()
public java.lang.Class getSerializer(java.lang.Class base)
getSerializer in interface cascading.tuple.type.SerializableTypepublic java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object object)
equals in class java.lang.ObjectCopyright © 2007-2021 Cascading Maintainers. All Rights Reserved.