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