org.springframework.data.util

## Class NullableWrapper

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

Direct Known Subclasses:
  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:
  `NullableWrapperConverters`

### Constructor Summary

Constructors
Constructor and Description
`NullableWrapper(Object value)` Creates a new `NullableWrapper` for the given value.

### Method Summary

All Methods Instance Methods Concrete Methods
`Object` `getValue()` Returns the backing value.
`Class<?>` `getValueType()` Returns the type of the contained value.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### NullableWrapper

    public NullableWrapper(@Nullable
                           Object value)

Creates a new `NullableWrapper` for the given value.

Parameters:
  `value` - can be null.

### Method Detail

#### 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.