From 8e8643122eb5783d4412c8a81fb03cc789c3f77c Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 9 Mar 2020 12:01:52 -0600 Subject: global: get rid of nonnull gradle hack Hacking things up via gradle is not right, and package-info.java poses problems with two modules, so instead we just apply it manually to every class. Remember to add this to new classes! Signed-off-by: Jason A. Donenfeld --- ui/src/main/java/com/wireguard/util/Keyed.java | 3 +++ ui/src/main/java/com/wireguard/util/KeyedList.java | 3 +++ ui/src/main/java/com/wireguard/util/SortedKeyedList.java | 3 +++ 3 files changed, 9 insertions(+) (limited to 'ui/src/main/java/com/wireguard/util') diff --git a/ui/src/main/java/com/wireguard/util/Keyed.java b/ui/src/main/java/com/wireguard/util/Keyed.java index f31a43a2..b4dc40cd 100644 --- a/ui/src/main/java/com/wireguard/util/Keyed.java +++ b/ui/src/main/java/com/wireguard/util/Keyed.java @@ -5,10 +5,13 @@ package com.wireguard.util; +import com.wireguard.util.NonNullForAll; + /** * Interface for objects that have a identifying key of the given type. */ +@NonNullForAll public interface Keyed { K getKey(); } diff --git a/ui/src/main/java/com/wireguard/util/KeyedList.java b/ui/src/main/java/com/wireguard/util/KeyedList.java index c116c1da..e0d06dbb 100644 --- a/ui/src/main/java/com/wireguard/util/KeyedList.java +++ b/ui/src/main/java/com/wireguard/util/KeyedList.java @@ -5,6 +5,8 @@ package com.wireguard.util; +import com.wireguard.util.NonNullForAll; + import androidx.annotation.Nullable; import java.util.Collection; @@ -15,6 +17,7 @@ import java.util.List; * {@code null} elements. */ +@NonNullForAll public interface KeyedList> extends List { boolean containsAllKeys(Collection keys); diff --git a/ui/src/main/java/com/wireguard/util/SortedKeyedList.java b/ui/src/main/java/com/wireguard/util/SortedKeyedList.java index b144fc85..7afc919e 100644 --- a/ui/src/main/java/com/wireguard/util/SortedKeyedList.java +++ b/ui/src/main/java/com/wireguard/util/SortedKeyedList.java @@ -5,6 +5,8 @@ package com.wireguard.util; +import com.wireguard.util.NonNullForAll; + import androidx.annotation.Nullable; import java.util.Collection; @@ -16,6 +18,7 @@ import java.util.Set; * applied to their keys. */ +@NonNullForAll public interface SortedKeyedList> extends KeyedList { Comparator comparator(); -- cgit v1.2.3