Java List Null Empty addIfValueNotNull(List list, V value)

Here you can find the source of addIfValueNotNull(List list, V value)

Description

add If Value Not Null

License

Apache License

Declaration

public static <V> boolean addIfValueNotNull(List<V> list, V value) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.List;

public class Main {
    public static <V> boolean addIfValueNotNull(List<V> list, V value) {
        if (value == null) {
            return false;
        }//from w  ww  .  j  av a 2  s.  c  o m

        return list.add(value);
    }
}

Related

  1. addAllExceptNullValue(List list, V[] values)
  2. addAllIfAllValuesNotNull(List list, V[] values)
  3. addIfNotNull(final List list, final T value)
  4. addIfNotNull(List l, T o)
  5. addIgnoreNull(final List list, final T... objects)
  6. addListNotNullValue(List sourceList, V value)
  7. addNonEmpty(List list, String value)
  8. addNotNull(List list, T t)