List of utility methods to do Collection Add
C | addTo(E element, C collection) Adds the given element to the given collection. collection.add(element);
return collection;
|
void | addTo(Map takes in a map K,List Collection<V> values = map.get(key); if (values == null) { values = new ArrayList<V>(); map.put(key, values); values.add(value); |
C | addToCollection(C collection, E... elements) Adds elements to a collection. if (collection == null || elements == null || elements.length == 0) { return collection; for (E e : elements) { collection.add(e); return collection; |
void | addToCollection(Collection Adds value to the Collection . if (collection != null && value != null) { try { collection.add(value); } catch (IllegalStateException e) { |
List | addToCollection(Collection add To Collection List<T> list = null; if (null == collection) { list = new ArrayList<>(); list.add(obj); } else { collection.add(obj); return list; ... |
void | addToCollection(Collection add To Collection for (T object : objects) {
theCollection.add(object);
|
Collection | addToCollection(Iterator add To Collection while (iterator.hasNext()) { T object = iterator.next(); collection.add(object); return Collections.unmodifiableCollection(collection); |
T | addToCollection(T dest, boolean failOnNull, Iterable extends V>... srcs) add To Collection for (Iterable<? extends V> src : srcs) { for (V v : src) { if (failOnNull && v == null) { throw new IllegalArgumentException("Illegal null value provided in this collection: " + src); dest.add(v); return dest; |
void | addToCollectionIfNotNull(Collection collection, Object value) add To Collection If Not Null if (value != null && collection != null) {
collection.add(value);
|
void | addToString(final Collection add To String if (element != null || stringifyNull) { output.add(String.valueOf(element)); } else { output.add(null); |