Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.jackson.datatype.guava.deser;
 
 
public final class GuavaOptionalDeserializer extends StdDeserializer<Optional<?>> {
    private final JavaType _referenceType;
    public GuavaOptionalDeserializer(JavaType valueType) {
        super(valueType);
         = valueType.containedType(0);
    }
    @Override
    public Optional<?> getNullValue() {
        return Optional.absent();
    }
    @Override
    public Optional<?> deserialize(JsonParser jpDeserializationContext ctxtthrows IOException,
            JsonProcessingException {
        Object reference = ctxt.findRootValueDeserializer().deserialize(jpctxt);
        return Optional.of(reference);
    }
New to GrepCode? Check out our FAQ X