Skip to content

Commit

Permalink
annotate items variable with nullable to allow null-safety kotlin com…
Browse files Browse the repository at this point in the history
…piler checks (#107)

Co-authored-by: Sab44 <>
  • Loading branch information
Sab44 authored Feb 15, 2022
1 parent 74c4872 commit 232519b
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.util.List;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;

/**
Expand Down Expand Up @@ -58,7 +59,7 @@
public abstract class AbsDelegationAdapter<T> extends RecyclerView.Adapter {

protected AdapterDelegatesManager<T> delegatesManager;
protected T items;
@Nullable protected T items;

public AbsDelegationAdapter() {
this(new AdapterDelegatesManager<T>());
Expand Down Expand Up @@ -128,6 +129,7 @@ public void onViewDetachedFromWindow(@NonNull RecyclerView.ViewHolder holder) {
*
* @return The items / data source
*/
@Nullable
public T getItems() {
return items;
}
Expand All @@ -137,7 +139,7 @@ public T getItems() {
*
* @param items The items / data source
*/
public void setItems(T items) {
public void setItems(@Nullable T items) {
this.items = items;
}
}

0 comments on commit 232519b

Please sign in to comment.