commit | 6918f363930078d138090de84a3dd3f6e5059233 | [log] [tgz] |
---|---|---|
author | Chiachang Wang <chiachangwang@google.com> | Thu Mar 11 01:03:15 2021 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Thu Mar 11 01:03:15 2021 +0000 |
tree | 057cd08b285c79ae272ecbce5c3913a73736a5f2 | |
parent | a7c245d1ceda885fddda7baa65355e3b974a02d7 [diff] | |
parent | 4dfe1ff50a9aaee99983e65cdaededf8b7e7ef81 [diff] |
Merge "Add helper function to check if collection is empty"
diff --git a/staticlibs/framework/com/android/net/module/util/CollectionUtils.java b/staticlibs/framework/com/android/net/module/util/CollectionUtils.java index 115f19d..2223443 100644 --- a/staticlibs/framework/com/android/net/module/util/CollectionUtils.java +++ b/staticlibs/framework/com/android/net/module/util/CollectionUtils.java
@@ -38,6 +38,13 @@ } /** + * @return True if the collection is null or 0-length. + */ + public static <T> boolean isEmpty(@Nullable Collection<T> collection) { + return collection == null || collection.isEmpty(); + } + + /** * Returns an int array from the given Integer list. */ @NonNull