diff --git a/src/main/java/org/springframework/data/repository/core/support/QueryExecutionResultHandler.java b/src/main/java/org/springframework/data/repository/core/support/QueryExecutionResultHandler.java index ca03e8a5c..9ad58352b 100644 --- a/src/main/java/org/springframework/data/repository/core/support/QueryExecutionResultHandler.java +++ b/src/main/java/org/springframework/data/repository/core/support/QueryExecutionResultHandler.java @@ -27,9 +27,9 @@ import org.springframework.core.MethodParameter; import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.TypeDescriptor; import org.springframework.core.convert.support.GenericConversionService; -import org.springframework.data.repository.util.NullableWrapper; import org.springframework.data.repository.util.QueryExecutionConverters; import org.springframework.data.repository.util.ReactiveWrapperConverters; +import org.springframework.data.util.NullableWrapper; import org.springframework.data.util.Streamable; import org.springframework.lang.Nullable; diff --git a/src/main/java/org/springframework/data/repository/util/NullableWrapper.java b/src/main/java/org/springframework/data/repository/util/NullableWrapper.java index c07c32ddb..b86649f92 100644 --- a/src/main/java/org/springframework/data/repository/util/NullableWrapper.java +++ b/src/main/java/org/springframework/data/repository/util/NullableWrapper.java @@ -23,12 +23,13 @@ import org.springframework.lang.Nullable; * convert {@literal null} into an object of some sort. * * @author Oliver Gierke + * @author Mark Paluch * @since 1.8 * @see QueryExecutionConverters + * @deprecated since 2.4, use {@link org.springframework.data.util.NullableWrapper} instead. */ -public class NullableWrapper { - - private final @Nullable Object value; +@Deprecated +public class NullableWrapper extends org.springframework.data.util.NullableWrapper { /** * Creates a new {@link NullableWrapper} for the given value. @@ -36,28 +37,6 @@ public class NullableWrapper { * @param value can be {@literal null}. */ public NullableWrapper(@Nullable Object value) { - this.value = value; - } - - /** - * Returns the type of the contained value. WIll fall back to {@link Object} in case the value is {@literal null}. - * - * @return will never be {@literal null}. - */ - public Class getValueType() { - - Object value = this.value; - - return value == null ? Object.class : value.getClass(); - } - - /** - * Returns the backing value. - * - * @return the value can be {@literal null}. - */ - @Nullable - public Object getValue() { - return value; + super(value); } } diff --git a/src/main/java/org/springframework/data/repository/util/QueryExecutionConverters.java b/src/main/java/org/springframework/data/repository/util/QueryExecutionConverters.java index a585a8f6b..74cf4abeb 100644 --- a/src/main/java/org/springframework/data/repository/util/QueryExecutionConverters.java +++ b/src/main/java/org/springframework/data/repository/util/QueryExecutionConverters.java @@ -15,10 +15,6 @@ */ package org.springframework.data.repository.util; -import scala.Function0; -import scala.Option; -import scala.runtime.AbstractFunction0; - import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -42,10 +38,11 @@ import org.springframework.core.convert.support.DefaultConversionService; import org.springframework.data.domain.Page; import org.springframework.data.domain.Slice; import org.springframework.data.geo.GeoResults; +import org.springframework.data.util.NullableWrapper; +import org.springframework.data.util.NullableWrapperConverters; import org.springframework.data.util.StreamUtils; import org.springframework.data.util.Streamable; import org.springframework.data.util.TypeInformation; -import org.springframework.lang.NonNull; import org.springframework.lang.Nullable; import org.springframework.scheduling.annotation.AsyncResult; import org.springframework.util.Assert; @@ -54,19 +51,13 @@ import org.springframework.util.ConcurrentReferenceHashMap; import org.springframework.util.ObjectUtils; import org.springframework.util.concurrent.ListenableFuture; -import com.google.common.base.Optional; - /** * Converters to potentially wrap the execution of a repository method into a variety of wrapper types potentially being * available on the classpath. Currently supported: *