Top Fields Constructors Methods
tools.jackson.databind.ext.jdk8

public Class Jdk8OptionalDeserializer

extends ReferenceTypeDeserializer<Optional<?>>
Class Inheritance
Imports
java.util.Optional, tools.jackson.databind.*, tools.jackson.databind.deser.ValueInstantiator, tools.jackson.databind.deser.std.ReferenceTypeDeserializer, tools.jackson.databind.jsontype.TypeDeserializer

Field Summary

Inherited from tools.jackson.databind.deser.std.ReferenceTypeDeserializer:
_fullType_valueDeserializer_valueInstantiator_valueTypeDeserializer

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Optional<?>
getNullValue(DeserializationContext ctxt)

Implements abstract tools.jackson.databind.deser.std.ReferenceTypeDeserializer.getNullValue.

Implements tools.jackson.databind.deser.NullValueProvider.getNullValue.

Method that can be called to determine value to be used for representing null values (values deserialized when JSON token is JsonToken#VALUE_NULL).

public Object
getReferenced(Optional<?> reference)

Implements abstract tools.jackson.databind.deser.std.ReferenceTypeDeserializer.getReferenced.

Method that may be called to find contents of specified reference, if any; or `null` if none.

public Optional<?>
public Optional<?>
updateReference(Optional<?> reference, Object contents)

Implements abstract tools.jackson.databind.deser.std.ReferenceTypeDeserializer.updateReference.

Method called in case of "merging update", in which we should try update reference instead of creating a new one.

public Jdk8OptionalDeserializer
withResolved(TypeDeserializer typeDeser, ValueDeserializer<?> valueDeser)

Implements abstract tools.jackson.databind.deser.std.ReferenceTypeDeserializer.withResolved.

Mutant factory method called when changes are needed; should construct newly configured instance with new values as indicated.

Inherited from tools.jackson.databind.deser.std.ReferenceTypeDeserializer:
createContextualdeserializedeserializedeserializeWithTypegetAbsentValuegetEmptyAccessPatterngetEmptyValuegetNullAccessPatterngetValueInstantiatorgetValueTypelogicalTypesupportsUpdate

Constructor Detail

Jdk8OptionalDeserializerback to summary
public Jdk8OptionalDeserializer(JavaType fullType, ValueInstantiator inst, TypeDeserializer typeDeser, ValueDeserializer<?> deser)

Method Detail

getNullValueback to summary
public Optional<?> getNullValue(DeserializationContext ctxt)

Implements abstract tools.jackson.databind.deser.std.ReferenceTypeDeserializer.getNullValue.

Implements tools.jackson.databind.deser.NullValueProvider.getNullValue.

Doc from tools.jackson.databind.ValueDeserializer.getNullValue.

Method that can be called to determine value to be used for representing null values (values deserialized when JSON token is JsonToken#VALUE_NULL). Usually this is simply Java null, but for some types (especially primitives) it may be necessary to use non-null values.

This method may be called once, or multiple times, depending on what getNullAccessPattern() returns.

Default implementation simply returns null.

Annotations
@Override
getReferencedback to summary
public Object getReferenced(Optional<?> reference)

Implements abstract tools.jackson.databind.deser.std.ReferenceTypeDeserializer.getReferenced.

Doc from tools.jackson.databind.deser.std.ReferenceTypeDeserializer.getReferenced.

Method that may be called to find contents of specified reference, if any; or `null` if none. Note that method should never fail, so for types that use concept of "absence" vs "presence", `null` is to be returned for both "absent" and "reference to `null`" cases.

Annotations
@Override
referenceValueback to summary
public Optional<?> referenceValue(Object contents)

Implements abstract tools.jackson.databind.deser.std.ReferenceTypeDeserializer.referenceValue.

Annotations
@Override
updateReferenceback to summary
public Optional<?> updateReference(Optional<?> reference, Object contents)

Implements abstract tools.jackson.databind.deser.std.ReferenceTypeDeserializer.updateReference.

Doc from tools.jackson.databind.deser.std.ReferenceTypeDeserializer.updateReference.

Method called in case of "merging update", in which we should try update reference instead of creating a new one. If this does not succeed, should just create a new instance.

Annotations
@Override
withResolvedback to summary
public Jdk8OptionalDeserializer withResolved(TypeDeserializer typeDeser, ValueDeserializer<?> valueDeser)

Implements abstract tools.jackson.databind.deser.std.ReferenceTypeDeserializer.withResolved.

Doc from tools.jackson.databind.deser.std.ReferenceTypeDeserializer.withResolved.

Mutant factory method called when changes are needed; should construct newly configured instance with new values as indicated.

Note

caller has verified that there are changes, so implementations need NOT check if a new instance is needed.

Annotations
@Override