Java List Null Empty addListNotNullValue(List sourceList, V value)

Here you can find the source of addListNotNullValue(List sourceList, V value)

Description

add List Not Null Value

License

Apache License

Declaration

public static <V> boolean addListNotNullValue(List<V> sourceList, V value) 

Method Source Code

//package com.java2s;
/**//from  ww w  .  jav  a2s . c om
 *  Copyright (c) 2014 http://www.lushapp.wang
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 */

import java.util.List;

public class Main {

    public static <V> boolean addListNotNullValue(List<V> sourceList, V value) {
        return (sourceList != null && value != null) ? sourceList.add(value) : false;
    }
}

Related

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