All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openapitools.jackson.nullable.JsonNullableValueExtractor Maven / Gradle / Ivy

Go to download

JsonNullable wrapper class and Jackson module to support fields with meaningful null values.

There is a newer version: 0.2.6
Show newest version
package org.openapitools.jackson.nullable;

import javax.validation.valueextraction.ExtractedValue;
import javax.validation.valueextraction.UnwrapByDefault;
import javax.validation.valueextraction.ValueExtractor;

/**
 * Extractor for JsonNullable
 */
@UnwrapByDefault
public class JsonNullableValueExtractor implements ValueExtractor> {
    @Override
    public void extractValues(JsonNullable originalValue, ValueReceiver receiver) {
        if (originalValue.isPresent()) {
            receiver.value(null, originalValue.get());
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy