From 00e59615c33ec795efd9ac0758d56c54a42dbbdc Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 08 Aug 2016 07:31:26 +0000
Subject: [PATCH] Partial OPENDJ-3106 Migrate Entry
---
opendj-server-legacy/src/main/java/org/opends/server/util/CollectionUtils.java | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/util/CollectionUtils.java b/opendj-server-legacy/src/main/java/org/opends/server/util/CollectionUtils.java
index 6aea607..dc11501 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/util/CollectionUtils.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/util/CollectionUtils.java
@@ -125,4 +125,16 @@
}
return outputCollection;
}
+
+ /**
+ * Returns whether the provided iterable is empty, i.e. whether it has not elements.
+ *
+ * @param iterable
+ * the iterable for which to omake the determination
+ * @return {@code true} if the iterable is empty, {@code false} otherwise.
+ */
+ public static boolean isEmpty(Iterable<?> iterable)
+ {
+ return !iterable.iterator().hasNext();
+ }
}
--
Gitblit v1.10.0