Skip to content

Make generic value types nullable #206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/main/java/org/dataloader/BatchLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.dataloader.annotations.PublicSpi;
import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

import java.util.List;
import java.util.concurrent.CompletionStage;
Expand Down Expand Up @@ -77,7 +78,7 @@
@FunctionalInterface
@PublicSpi
@NullMarked
public interface BatchLoader<K, V> {
public interface BatchLoader<K, V extends @Nullable Object> {

/**
* Called to batch load the provided keys and return a promise to a list of values.
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/dataloader/BatchLoaderWithContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.dataloader.annotations.PublicSpi;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

import java.util.List;
import java.util.concurrent.CompletionStage;
Expand All @@ -16,7 +17,7 @@
*/
@PublicSpi
@NullMarked
public interface BatchLoaderWithContext<K, V> {
public interface BatchLoaderWithContext<K, V extends @Nullable Object> {
/**
* Called to batch load the provided keys and return a promise to a list of values. This default
* version can be given an environment object to that maybe be useful during the call. A typical use case
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/dataloader/BatchPublisher.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
@NullMarked
@PublicSpi
public interface BatchPublisher<K, V> {
public interface BatchPublisher<K, V extends @Nullable Object> {
/**
* Called to batch the provided keys into a stream of values. You <b>must</b> provide
* the same number of values as there as keys, and they <b>must</b> be in the order of the keys.
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/dataloader/BatchPublisherWithContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.dataloader.annotations.PublicSpi;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import org.reactivestreams.Subscriber;

import java.util.List;
Expand All @@ -16,7 +17,7 @@
*/
@NullMarked
@PublicSpi
public interface BatchPublisherWithContext<K, V> {
public interface BatchPublisherWithContext<K, V extends @Nullable Object> {
/**
* Called to batch the provided keys into a stream of values. You <b>must</b> provide
* the same number of values as there as keys, and they <b>must</b> be in the order of the keys.
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/dataloader/MappedBatchLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import org.dataloader.annotations.PublicSpi;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -59,7 +60,7 @@
*/
@PublicSpi
@NullMarked
public interface MappedBatchLoader<K, V> {
public interface MappedBatchLoader<K, V extends @Nullable Object> {

/**
* Called to batch load the provided keys and return a promise to a map of values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import org.dataloader.annotations.PublicSpi;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

import java.util.Map;
import java.util.Set;
Expand All @@ -33,7 +34,7 @@
*/
@PublicSpi
@NullMarked
public interface MappedBatchLoaderWithContext<K, V> {
public interface MappedBatchLoaderWithContext<K, V extends @Nullable Object> {
/**
* Called to batch load the provided keys and return a promise to a map of values.
*
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/dataloader/MappedBatchPublisher.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.dataloader.annotations.PublicSpi;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import org.reactivestreams.Subscriber;

import java.util.Map;
Expand All @@ -20,7 +21,7 @@
*/
@PublicSpi
@NullMarked
public interface MappedBatchPublisher<K, V> {
public interface MappedBatchPublisher<K, V extends @Nullable Object> {
/**
* Called to batch the provided keys into a stream of map entries of keys and values.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.dataloader.annotations.PublicSpi;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import org.reactivestreams.Subscriber;

import java.util.List;
Expand All @@ -17,7 +18,7 @@
*/
@PublicSpi
@NullMarked
public interface MappedBatchPublisherWithContext<K, V> {
public interface MappedBatchPublisherWithContext<K, V extends @Nullable Object> {

/**
* Called to batch the provided keys into a stream of map entries of keys and values.
Expand Down