diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-03-26 23:54:44 -0600 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-03-27 03:08:47 -0600 |
commit | 48a9fd46a679db5cc4baa0ffd03b14d006bab04a (patch) | |
tree | b0e1647a9bba066d6c6870a397d513912782fcad /ui/src/main/java/com/wireguard/util | |
parent | 8669c01eaa47a39d2c36147d4dbe2e987e0520c9 (diff) |
databinding: rewrite in kotlin
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui/src/main/java/com/wireguard/util')
-rw-r--r-- | ui/src/main/java/com/wireguard/util/Keyed.java | 15 | ||||
-rw-r--r-- | ui/src/main/java/com/wireguard/util/KeyedList.java | 33 | ||||
-rw-r--r-- | ui/src/main/java/com/wireguard/util/SortedKeyedList.java | 32 |
3 files changed, 0 insertions, 80 deletions
diff --git a/ui/src/main/java/com/wireguard/util/Keyed.java b/ui/src/main/java/com/wireguard/util/Keyed.java deleted file mode 100644 index 0cc85d50..00000000 --- a/ui/src/main/java/com/wireguard/util/Keyed.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright © 2017-2019 WireGuard LLC. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.wireguard.util; - -/** - * Interface for objects that have a identifying key of the given type. - */ - -@NonNullForAll -public interface Keyed<K> { - K getKey(); -} diff --git a/ui/src/main/java/com/wireguard/util/KeyedList.java b/ui/src/main/java/com/wireguard/util/KeyedList.java deleted file mode 100644 index 48bba484..00000000 --- a/ui/src/main/java/com/wireguard/util/KeyedList.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright © 2017-2019 WireGuard LLC. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.wireguard.util; - -import java.util.Collection; -import java.util.List; - -import androidx.annotation.Nullable; - -/** - * A list containing elements that can be looked up by key. A {@code KeyedList} cannot contain - * {@code null} elements. - */ - -@NonNullForAll -public interface KeyedList<K, E extends Keyed<? extends K>> extends List<E> { - boolean containsAllKeys(Collection<K> keys); - - boolean containsKey(K key); - - @Nullable - E get(K key); - - @Nullable - E getLast(K key); - - int indexOfKey(K key); - - int lastIndexOfKey(K key); -} diff --git a/ui/src/main/java/com/wireguard/util/SortedKeyedList.java b/ui/src/main/java/com/wireguard/util/SortedKeyedList.java deleted file mode 100644 index 80c50bed..00000000 --- a/ui/src/main/java/com/wireguard/util/SortedKeyedList.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright © 2017-2019 WireGuard LLC. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.wireguard.util; - -import java.util.Collection; -import java.util.Comparator; -import java.util.Set; - -import androidx.annotation.Nullable; - -/** - * A keyed list where all elements are sorted by the comparator returned by {@code comparator()} - * applied to their keys. - */ - -@NonNullForAll -public interface SortedKeyedList<K, E extends Keyed<? extends K>> extends KeyedList<K, E> { - Comparator<? super K> comparator(); - - @Nullable - K firstKey(); - - Set<K> keySet(); - - @Nullable - K lastKey(); - - Collection<E> values(); -} |