List of utility methods to do List Null Empty
void | addAllExceptNullValue(List add All Except Null Value if (values == null) { return; for (V value : values) { addIfValueNotNull(list, value); |
boolean | addAllIfAllValuesNotNull(List add All If All Values Not Null if (values == null) { return false; for (V value : values) { if (value == null) { return false; for (V value : values) { list.add(value); return true; |
boolean | addIfNotNull(final List Adds to List if value is not null. return value != null ? list.add(value) : false;
|
List | addIfNotNull(List Add a value to a list if the value is not null. if (o != null) l.add(o); return l; |
boolean | addIfValueNotNull(List add If Value Not Null if (value == null) { return false; return list.add(value); |
List | addIgnoreNull(final List Adds the ignore null. if (objects == null) return list; for (final T object : objects) if (object != null) list.add(object); return list; |
boolean | addListNotNullValue(List add List Not Null Value return (sourceList != null && value != null) ? sourceList.add(value) : false;
|
void | addNonEmpty(List add Non Empty if (!isBlank(value)) {
list.add(value.trim());
|
List | addNotNull(List add Not Null if (t != null) list.add(t); return list; |
int | countIgnoreNull(List list) count Ignore Null int cnt = 0; for (Object i : list) if (i != null) cnt++; return cnt; |