package io.dropwizard.validation.valuehandling;
import org.hibernate.validator.spi.valuehandling.ValidatedValueUnwrapper;
import javax.annotation.Nullable;
import java.lang.reflect.Type;
import java.util.OptionalDouble;
public class OptionalDoubleValidatedValueUnwrapper extends ValidatedValueUnwrapper<OptionalDouble> {
@Override
@Nullable
public Object handleValidatedValue(final OptionalDouble optional) {
return optional.isPresent() ? optional.getAsDouble() : null;
}
@Override
public Type getValidatedValueType(final Type type) {
return Double.class;
}
}