Spring Data Core

org.springframework.data.repository.util
Class NullableWrapper

java.lang.Object
  extended by org.springframework.data.repository.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:
1.8
Author:
Oliver Gierke
See Also:
QueryExecutionConverters

Constructor Summary
NullableWrapper(Object value)
          Creates a new NullableWrapper for the given value.
 
Method Summary
 Object getValue()
          Returns the backing valie
 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(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

public Object getValue()
Returns the backing valie

Returns:
the value can be null.

Spring Data Core

Copyright © 2011-2014–2014 Pivotal Software, Inc.. All rights reserved.