Android examples for java.util:List Element
add not null entry to list
//package com.java2s; import java.util.List; public class Main { /**/* www .j av a 2s.c o m*/ * add not null entry to list * * @param sourceList * @param value * @return <ul> * <li>if sourceList is null, return false</li> * <li>if value is null, return false</li> * <li>return {@link List#add(Object)}</li> * </ul> */ public static <V> boolean addListNotNullValue(List<V> sourceList, V value) { return (sourceList != null && value != null) ? sourceList .add(value) : false; } }