public boolean putAll(K key, Iterable<? extends V> values) { return Iterate.notEmpty(values) && this.putAllNotEmpty(key, values); }
public I valueOf(T1 object) { for (Function<T1, I> function : this.functions) { I result = function.valueOf(object); if (Iterate.notEmpty(result)) { return result; } } return null; } }
/** * @see RichIterable#appendString(Appendable, String, String, String) */ public static <T> void appendString( List<T> list, Appendable appendable, String start, String separator, String end) { try { appendable.append(start); if (Iterate.notEmpty(list)) { appendable.append(IterableIterate.stringValueOfItem(list, list.get(0))); int size = list.size(); for (int i = 1; i < size; i++) { appendable.append(separator); appendable.append(IterableIterate.stringValueOfItem(list, list.get(i))); } } appendable.append(end); } catch (IOException e) { throw new RuntimeException(e); } }
ForkJoinPool executor) if (Iterate.notEmpty(iterable))
Executor executor) if (Iterate.notEmpty(iterable))
/** * Assert that the given {@link MutableMapIterable} is <em>not</em> empty. */ public static void assertNotEmpty(String mutableMapIterableName, MutableMapIterable<?, ?> actualMutableMapIterable) { try { Verify.assertObjectNotNull(mutableMapIterableName, actualMutableMapIterable); Assert.assertFalse(mutableMapIterableName + " should be non-empty, but was empty", Iterate.isEmpty(actualMutableMapIterable)); Assert.assertTrue(mutableMapIterableName + " should be non-empty, but was empty", Iterate.notEmpty(actualMutableMapIterable)); Assert.assertTrue(mutableMapIterableName + " should be non-empty, but was empty", actualMutableMapIterable.notEmpty()); Assert.assertNotEquals(mutableMapIterableName + " should be non-empty, but was empty", 0, actualMutableMapIterable.size()); Assert.assertNotEquals(mutableMapIterableName + " should be non-empty, but was empty", 0, actualMutableMapIterable.keySet().size()); Assert.assertNotEquals(mutableMapIterableName + " should be non-empty, but was empty", 0, actualMutableMapIterable.values().size()); Assert.assertNotEquals(mutableMapIterableName + " should be non-empty, but was empty", 0, actualMutableMapIterable.entrySet().size()); } catch (AssertionError e) { Verify.throwMangledException(e); } }
/** * Assert that the given {@link Iterable} is <em>not</em> empty. */ public static void assertNotEmpty(String iterableName, Iterable<?> actualIterable) { try { Verify.assertObjectNotNull(iterableName, actualIterable); Assert.assertFalse(iterableName + " should be non-empty, but was empty", Iterate.isEmpty(actualIterable)); Assert.assertTrue(iterableName + " should be non-empty, but was empty", Iterate.notEmpty(actualIterable)); Assert.assertNotEquals(iterableName + " should be non-empty, but was empty", 0, Iterate.sizeOf(actualIterable)); } catch (AssertionError e) { Verify.throwMangledException(e); } }
/** * Assert that the given {@link Iterable} is <em>not</em> empty. */ public static void assertIterableNotEmpty(String iterableName, Iterable<?> iterable) { try { Verify.assertObjectNotNull(iterableName, iterable); Assert.assertFalse(iterableName + " should be non-empty, but was empty", Iterate.isEmpty(iterable)); Assert.assertTrue(iterableName + " should be non-empty, but was empty", Iterate.notEmpty(iterable)); Assert.assertNotEquals(iterableName + " should be non-empty, but was empty", 0, Iterate.sizeOf(iterable)); } catch (AssertionError e) { Verify.throwMangledException(e); } }
Executor executor) if (Iterate.notEmpty(iterable))
ForkJoinPool executor) if (Iterate.notEmpty(iterable))
if (Iterate.notEmpty(actualMutableMapIterable))
/** * Assert that the given {@link Collection} is empty. */ public static void assertEmpty(String iterableName, Iterable<?> actualIterable) { try { Verify.assertObjectNotNull(iterableName, actualIterable); if (Iterate.notEmpty(actualIterable)) { Assert.fail(iterableName + " should be empty; actual size:<" + Iterate.sizeOf(actualIterable) + '>'); } if (!Iterate.isEmpty(actualIterable)) { Assert.fail(iterableName + " should be empty; actual size:<" + Iterate.sizeOf(actualIterable) + '>'); } if (Iterate.sizeOf(actualIterable) != 0) { Assert.fail(iterableName + " should be empty; actual size:<" + Iterate.sizeOf(actualIterable) + '>'); } } catch (AssertionError e) { Verify.throwMangledException(e); } }
/** * Assert that the given {@link Iterable} is empty. */ public static void assertIterableEmpty(String iterableName, Iterable<?> iterable) { try { Verify.assertObjectNotNull(iterableName, iterable); if (Iterate.notEmpty(iterable)) { Assert.fail(iterableName + " should be empty; actual size:<" + Iterate.sizeOf(iterable) + '>'); } if (!Iterate.isEmpty(iterable)) { Assert.fail(iterableName + " should be empty; actual size:<" + Iterate.sizeOf(iterable) + '>'); } if (Iterate.sizeOf(iterable) != 0) { Assert.fail(iterableName + " should be empty; actual size:<" + Iterate.sizeOf(iterable) + '>'); } } catch (AssertionError e) { Verify.throwMangledException(e); } }
public I valueOf(T1 object) { for (Function<T1, I> function : this.functions) { I result = function.valueOf(object); if (Iterate.notEmpty(result)) { return result; } } return null; } }
public boolean putAll(K key, Iterable<? extends V> values) { return Iterate.notEmpty(values) && this.putAllNotEmpty(key, values); }
/** * Assert that the given {@link Iterable} is <em>not</em> empty. */ public static void assertNotEmpty(String iterableName, Iterable<?> actualIterable) { try { Verify.assertObjectNotNull(iterableName, actualIterable); Assert.assertFalse(iterableName + " should be non-empty, but was empty", Iterate.isEmpty(actualIterable)); Assert.assertTrue(iterableName + " should be non-empty, but was empty", Iterate.notEmpty(actualIterable)); Assert.assertNotEquals(iterableName + " should be non-empty, but was empty", 0, Iterate.sizeOf(actualIterable)); } catch (AssertionError e) { Verify.throwMangledException(e); } }
/** * Assert that the given {@link Iterable} is <em>not</em> empty. */ public static void assertIterableNotEmpty(String iterableName, Iterable<?> iterable) { try { Verify.assertObjectNotNull(iterableName, iterable); Assert.assertFalse(iterableName + " should be non-empty, but was empty", Iterate.isEmpty(iterable)); Assert.assertTrue(iterableName + " should be non-empty, but was empty", Iterate.notEmpty(iterable)); Assert.assertNotEquals(iterableName + " should be non-empty, but was empty", 0, Iterate.sizeOf(iterable)); } catch (AssertionError e) { Verify.throwMangledException(e); } }
/** * Assert that the given {@link MutableMapIterable} is <em>not</em> empty. */ public static void assertNotEmpty(String mutableMapIterableName, MutableMapIterable<?, ?> actualMutableMapIterable) { try { Verify.assertObjectNotNull(mutableMapIterableName, actualMutableMapIterable); Assert.assertFalse(mutableMapIterableName + " should be non-empty, but was empty", Iterate.isEmpty(actualMutableMapIterable)); Assert.assertTrue(mutableMapIterableName + " should be non-empty, but was empty", Iterate.notEmpty(actualMutableMapIterable)); Assert.assertTrue(mutableMapIterableName + " should be non-empty, but was empty", actualMutableMapIterable.notEmpty()); Assert.assertNotEquals(mutableMapIterableName + " should be non-empty, but was empty", 0, actualMutableMapIterable.size()); Assert.assertNotEquals(mutableMapIterableName + " should be non-empty, but was empty", 0, actualMutableMapIterable.keySet().size()); Assert.assertNotEquals(mutableMapIterableName + " should be non-empty, but was empty", 0, actualMutableMapIterable.values().size()); Assert.assertNotEquals(mutableMapIterableName + " should be non-empty, but was empty", 0, actualMutableMapIterable.entrySet().size()); } catch (AssertionError e) { Verify.throwMangledException(e); } }
/** * Assert that the given {@link Iterable} is empty. */ public static void assertIterableEmpty(String iterableName, Iterable<?> iterable) { try { Verify.assertObjectNotNull(iterableName, iterable); if (Iterate.notEmpty(iterable)) { Assert.fail(iterableName + " should be empty; actual size:<" + Iterate.sizeOf(iterable) + '>'); } if (!Iterate.isEmpty(iterable)) { Assert.fail(iterableName + " should be empty; actual size:<" + Iterate.sizeOf(iterable) + '>'); } if (Iterate.sizeOf(iterable) != 0) { Assert.fail(iterableName + " should be empty; actual size:<" + Iterate.sizeOf(iterable) + '>'); } } catch (AssertionError e) { Verify.throwMangledException(e); } }
/** * Assert that the given {@link Collection} is empty. */ public static void assertEmpty(String iterableName, Iterable<?> actualIterable) { try { Verify.assertObjectNotNull(iterableName, actualIterable); if (Iterate.notEmpty(actualIterable)) { Assert.fail(iterableName + " should be empty; actual size:<" + Iterate.sizeOf(actualIterable) + '>'); } if (!Iterate.isEmpty(actualIterable)) { Assert.fail(iterableName + " should be empty; actual size:<" + Iterate.sizeOf(actualIterable) + '>'); } if (Iterate.sizeOf(actualIterable) != 0) { Assert.fail(iterableName + " should be empty; actual size:<" + Iterate.sizeOf(actualIterable) + '>'); } } catch (AssertionError e) { Verify.throwMangledException(e); } }