Top Fields Constructors Methods
tools.jackson.datatype.guava.deser

public Class GuavaOptionalDeserializer

extends ReferenceTypeDeserializer<Optional<?>>
Class Inheritance
Imports
tools.jackson.databind.*, tools.jackson.databind.deser.ValueInstantiator, tools.jackson.databind.deser.std.ReferenceTypeDeserializer, tools.jackson.databind.jsontype.TypeDeserializer, com.google.common.base.Optional

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 Object
getEmptyValue(DeserializationContext ctxt)

Overrides tools.jackson.databind.deser.std.ReferenceTypeDeserializer.getEmptyValue.

Method called to determine value to be used for "empty" values (most commonly when deserializing from empty JSON Strings).

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 GuavaOptionalDeserializer
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:
createContextualdeserializedeserializedeserializeWithTypegetAbsentValuegetEmptyAccessPatterngetNullAccessPatterngetValueInstantiatorgetValueTypelogicalTypesupportsUpdate

Constructor Detail

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

Method Detail

getEmptyValueback to summary
public Object getEmptyValue(DeserializationContext ctxt)

Overrides tools.jackson.databind.deser.std.ReferenceTypeDeserializer.getEmptyValue.

Doc from tools.jackson.databind.ValueDeserializer.getEmptyValue.

Method called to determine value to be used for "empty" values (most commonly when deserializing from empty JSON Strings). Usually this is same as getNullValue (which in turn is usually simply Java null), but it can be overridden for specific types. Or, if type should never be converted from empty String, method can also throw an exception.

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

Default implementation simply calls getNullValue and returns value.

Annotations
@Override
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 GuavaOptionalDeserializer 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