commit | 266082289a5307e77d6231f3bc742438b883a111 | [log] [tgz] |
---|---|---|
author | Chiachang Wang <chiachangwang@google.com> | Thu Mar 11 03:17:24 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Mar 11 03:17:24 2021 +0000 |
tree | b75594e46c909be1fe2c2901d6518f292347bf65 | |
parent | 06ee6d27852bcbd5b66e2eb3c51fe8ccf2be7d20 [diff] | |
parent | 6918f363930078d138090de84a3dd3f6e5059233 [diff] |
Merge "Add helper function to check if collection is empty" am: 78e2f0d124 am: 0a62bcbc24 Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1605116 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Idedfd108bac297ec564776ce237829848ebb622f
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