List of utility methods to do Collection Add
void | addNonNull(Object element, Collection result) add Non Null if (element != null) {
result.add(element);
|
void | addNonnullIfMissing(Collection Adds an element to a collection only if the latter does not contain it and the element is not null. if (collection == null) throw new IllegalArgumentException(); if (element != null && !collection.contains(element)) { collection.add(element); |
Collection | addNonNulls(Collection add those elements which are not null to the given collection and return it for (X x : xl) { if (x != null) c.add(x); return c; |
void | addNotNull(Collection add Not Null if (toAdd != null && toAdd.length() > 0 && !col.contains(toAdd.trim())) {
col.add(toAdd.trim());
|
void | addOneValueUNSAFE(Collection cloneCollection, Object v) add One Value UNSAFE cloneCollection.add(v); |
Collection | addPrefix(Collection add Prefix Collection<String> newValues = new ArrayList<String>(); for (String value : values) { newValues.add(prefix + value); return newValues; |
void | addPreviousTags(int index, String[] prevTags, int prevTagsToAdd, Collection add Previous Tags if (prevTags == null) { prevTags = EMPTY_STRING_ARRAY; if (index - 1 >= prevTags.length) { throw new IllegalStateException(); for (int pt = 1; pt <= prevTagsToAdd; pt++) { int t = index - pt; ... |
void | addRange(Collection Adds values into the given collection using integer in the specified range and step size. if (step <= 0) throw new RuntimeException("Would create an infinite loop"); for (int i = start; i < to; i += step) c.add(i); |
boolean | addSafe(final Collection Similar to Collection.add() but only allows non-null elements. if (element != null) { return collection.add(element); } else { return false; |
T | addTo(Collection l, Object... os) add To Collections.addAll(l, os);
return (T) l;
|