diff --git a/pom.xml b/pom.xml
index 2f79fad..42d6570 100644
--- a/pom.xml
+++ b/pom.xml
@@ -45,7 +45,6 @@
${querydsl}
true
-
diff --git a/src/main/java/org/springframework/data/keyvalue/annotation/package-info.java b/src/main/java/org/springframework/data/keyvalue/annotation/package-info.java
index e4994ad..acad4dc 100644
--- a/src/main/java/org/springframework/data/keyvalue/annotation/package-info.java
+++ b/src/main/java/org/springframework/data/keyvalue/annotation/package-info.java
@@ -1,6 +1,5 @@
/**
* Key-Value annotations for declarative keyspace configuration.
*/
-@org.springframework.lang.NonNullApi
-@org.springframework.lang.NonNullFields
+@org.jspecify.annotations.NullMarked
package org.springframework.data.keyvalue.annotation;
diff --git a/src/main/java/org/springframework/data/keyvalue/aot/KeyValueRuntimeHints.java b/src/main/java/org/springframework/data/keyvalue/aot/KeyValueRuntimeHints.java
index b4417b3..8959193 100644
--- a/src/main/java/org/springframework/data/keyvalue/aot/KeyValueRuntimeHints.java
+++ b/src/main/java/org/springframework/data/keyvalue/aot/KeyValueRuntimeHints.java
@@ -18,13 +18,13 @@ package org.springframework.data.keyvalue.aot;
import java.util.Arrays;
import java.util.List;
+import org.jspecify.annotations.Nullable;
import org.springframework.aot.hint.ExecutableMode;
import org.springframework.aot.hint.MemberCategory;
import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.RuntimeHintsRegistrar;
import org.springframework.aot.hint.TypeReference;
import org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery;
-import org.springframework.lang.Nullable;
/**
* {@link RuntimeHintsRegistrar} for KeyValue.
diff --git a/src/main/java/org/springframework/data/keyvalue/aot/package-info.java b/src/main/java/org/springframework/data/keyvalue/aot/package-info.java
new file mode 100644
index 0000000..199fb4a
--- /dev/null
+++ b/src/main/java/org/springframework/data/keyvalue/aot/package-info.java
@@ -0,0 +1,5 @@
+/**
+ * Support classes for key-value ahead of time computation
+ */
+@org.jspecify.annotations.NullMarked
+package org.springframework.data.keyvalue.aot;
diff --git a/src/main/java/org/springframework/data/keyvalue/core/AbstractKeyValueAdapter.java b/src/main/java/org/springframework/data/keyvalue/core/AbstractKeyValueAdapter.java
index 80868a8..d64e226 100644
--- a/src/main/java/org/springframework/data/keyvalue/core/AbstractKeyValueAdapter.java
+++ b/src/main/java/org/springframework/data/keyvalue/core/AbstractKeyValueAdapter.java
@@ -18,8 +18,8 @@ package org.springframework.data.keyvalue.core;
import java.util.Collection;
import java.util.Comparator;
+import org.jspecify.annotations.Nullable;
import org.springframework.data.keyvalue.core.query.KeyValueQuery;
-import org.springframework.lang.Nullable;
/**
* Base implementation of {@link KeyValueAdapter} holds {@link QueryEngine} to delegate {@literal find} and
@@ -69,15 +69,13 @@ public abstract class AbstractKeyValueAdapter implements KeyValueAdapter {
return engine;
}
- @Nullable
@Override
- public T get(Object id, String keyspace, Class type) {
+ public @Nullable T get(Object id, String keyspace, Class type) {
return type.cast(get(id, keyspace));
}
- @Nullable
@Override
- public T delete(Object id, String keyspace, Class type) {
+ public @Nullable T delete(Object id, String keyspace, Class type) {
return type.cast(delete(id, keyspace));
}
diff --git a/src/main/java/org/springframework/data/keyvalue/core/CriteriaAccessor.java b/src/main/java/org/springframework/data/keyvalue/core/CriteriaAccessor.java
index d50c626..2e226de 100644
--- a/src/main/java/org/springframework/data/keyvalue/core/CriteriaAccessor.java
+++ b/src/main/java/org/springframework/data/keyvalue/core/CriteriaAccessor.java
@@ -15,8 +15,8 @@
*/
package org.springframework.data.keyvalue.core;
+import org.jspecify.annotations.Nullable;
import org.springframework.data.keyvalue.core.query.KeyValueQuery;
-import org.springframework.lang.Nullable;
/**
* Resolves the criteria object from given {@link KeyValueQuery}.
diff --git a/src/main/java/org/springframework/data/keyvalue/core/ForwardingCloseableIterator.java b/src/main/java/org/springframework/data/keyvalue/core/ForwardingCloseableIterator.java
index 3867d74..4a3a89f 100644
--- a/src/main/java/org/springframework/data/keyvalue/core/ForwardingCloseableIterator.java
+++ b/src/main/java/org/springframework/data/keyvalue/core/ForwardingCloseableIterator.java
@@ -17,8 +17,8 @@ package org.springframework.data.keyvalue.core;
import java.util.Iterator;
+import org.jspecify.annotations.Nullable;
import org.springframework.data.util.CloseableIterator;
-import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
/**
diff --git a/src/main/java/org/springframework/data/keyvalue/core/GeneratingIdAccessor.java b/src/main/java/org/springframework/data/keyvalue/core/GeneratingIdAccessor.java
index 46a07ac..d4ccc68 100644
--- a/src/main/java/org/springframework/data/keyvalue/core/GeneratingIdAccessor.java
+++ b/src/main/java/org/springframework/data/keyvalue/core/GeneratingIdAccessor.java
@@ -15,6 +15,7 @@
*/
package org.springframework.data.keyvalue.core;
+import org.jspecify.annotations.Nullable;
import org.springframework.data.mapping.IdentifierAccessor;
import org.springframework.data.mapping.PersistentProperty;
import org.springframework.data.mapping.PersistentPropertyAccessor;
@@ -55,7 +56,7 @@ class GeneratingIdAccessor implements IdentifierAccessor {
}
@Override
- public Object getIdentifier() {
+ public @Nullable Object getIdentifier() {
return accessor.getProperty(identifierProperty);
}
diff --git a/src/main/java/org/springframework/data/keyvalue/core/KeyValueAdapter.java b/src/main/java/org/springframework/data/keyvalue/core/KeyValueAdapter.java
index f3eaf1d..e484830 100644
--- a/src/main/java/org/springframework/data/keyvalue/core/KeyValueAdapter.java
+++ b/src/main/java/org/springframework/data/keyvalue/core/KeyValueAdapter.java
@@ -18,10 +18,10 @@ package org.springframework.data.keyvalue.core;
import java.util.Collection;
import java.util.Map;
+import org.jspecify.annotations.Nullable;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.data.keyvalue.core.query.KeyValueQuery;
import org.springframework.data.util.CloseableIterator;
-import org.springframework.lang.Nullable;
/**
* {@link KeyValueAdapter} unifies access and shields the underlying key/value specific implementation.
@@ -39,7 +39,7 @@ public interface KeyValueAdapter extends DisposableBean {
* @param keyspace must not be {@literal null}.
* @return the item previously associated with the id.
*/
- Object put(Object id, Object item, String keyspace);
+ @Nullable Object put(Object id, Object item, String keyspace);
/**
* Check if a object with given id exists in keyspace.
@@ -69,8 +69,7 @@ public interface KeyValueAdapter extends DisposableBean {
* @return {@literal null} in case no matching item exists.
* @since 1.1
*/
- @Nullable
- T get(Object id, String keyspace, Class type);
+ @Nullable T get(Object id, String keyspace, Class type);
/**
* Delete and return the object with given type and id.
@@ -91,8 +90,7 @@ public interface KeyValueAdapter extends DisposableBean {
* @return {@literal null} if object could not be found
* @since 1.1
*/
- @Nullable
- T delete(Object id, String keyspace, Class type);
+ @Nullable T delete(Object id, String keyspace, Class type);
/**
* Get all elements for given keyspace.
@@ -100,7 +98,7 @@ public interface KeyValueAdapter extends DisposableBean {
* @param keyspace must not be {@literal null}.
* @return empty {@link Collection} if nothing found.
*/
- Iterable> getAllOf(String keyspace);
+ Iterable