Java List Null Empty addNotNull(List list, T t)

Here you can find the source of addNotNull(List list, T t)

Description

add Not Null

License

Open Source License

Declaration

public static <T> List<T> addNotNull(List<T> list, T t) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.List;

public class Main {
    public static <T> List<T> addNotNull(List<T> list, T t) {
        if (t != null)
            list.add(t);/*from  ww w. j  a  va  2  s.  c o  m*/
        return list;
    }
}

Related

  1. addIfNotNull(List l, T o)
  2. addIfValueNotNull(List list, V value)
  3. addIgnoreNull(final List list, final T... objects)
  4. addListNotNullValue(List sourceList, V value)
  5. addNonEmpty(List list, String value)
  6. countIgnoreNull(List list)
  7. emptyStringList()
  8. emptyToNull(List list)
  9. emptyToNull(List list)