org.openapitools.jackson.nullable.JsonNullableValueExtractor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jackson-databind-nullable Show documentation
Show all versions of jackson-databind-nullable Show documentation
JsonNullable wrapper class and Jackson module to support fields with meaningful null values.
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