Class NullableWrapper

java.lang.Object
org.springframework.data.util.NullableWrapper

public class NullableWrapper extends Object
Simple value object to wrap a nullable delegate. Used to be able to write Converter implementations that convert null into an object of some sort.
Since:
2.4
Author:
Oliver Gierke, Mark Paluch
See Also:
  • Constructor Details

    • NullableWrapper

      public NullableWrapper(@Nullable Object value)
      Creates a new NullableWrapper for the given value.
      Parameters:
      value - can be null.
  • Method Details

    • getValueType

      public Class<?> getValueType()
      Returns the type of the contained value. Will fall back to Object in case the value is null.
      Returns:
      will never be null.
    • getValue

      @Nullable public Object getValue()
      Returns the backing value.
      Returns:
      the value can be null.