List of usage examples for org.apache.commons.collections4 ListUtils removeAll
public static <E> List<E> removeAll(final Collection<E> collection, final Collection<?> remove)
remove
from collection
. From source file:com.sunchenbin.store.feilong.core.util.CollectionsUtil.java
/** * <code>collection</code> <code>remove</code>. ?,?(???). * //from w w w .j av a 2 s .c o m * <p> * The cardinality of an element <code>e</code> in the returned collection is the same as the cardinality of <code>e</code> in * <code>collection</code> unless <code>remove</code> contains <code>e</code>, in which case the cardinality is zero. * </p> * * <p> * ?,? <code>collection</code>?,? <code>collection.removeAll(remove);</code>. * </p> * * <p> * {@link ListUtils#removeAll(Collection, Collection)},?<code>removeElement</code> list. * </p> * * @param <T> * the generic type * @param collection * the collection from which items are removed (in the returned collection) * @param remove * the items to be removed from the returned <code>collection</code> * @return a <code>List</code> containing all the elements of <code>c</code> except * any elements that also occur in <code>remove</code>. * @see ListUtils#removeAll(Collection, Collection) * @since Commons Collections 3.2 * @since 1.0.8 */ public static <T> List<T> removeAll(Collection<T> collection, Collection<T> remove) { return ListUtils.removeAll(collection, remove); }
From source file:com.thoughtworks.go.config.BasicCruiseConfig.java
private List<PartialConfig> removePartialsThatDoNotCorrespondToTheCurrentConfigReposList( List<PartialConfig> partList) { List<Object> notToBeMerged = new ArrayList<>(); for (PartialConfig partialConfig : partList) { if (partialConfig.getOrigin() instanceof RepoConfigOrigin) { RepoConfigOrigin origin = (RepoConfigOrigin) partialConfig.getOrigin(); if (!configRepos.hasMaterialWithFingerprint(origin.getMaterial().getFingerprint())) notToBeMerged.add(partialConfig); }/*from w ww . j a v a2 s . co m*/ } partList = ListUtils.removeAll(partList, notToBeMerged); return partList; }
From source file:com.feilong.core.util.CollectionsUtil.java
/** * <code>collection</code> <code>remove</code>. * // w w w . j a va2 s . c om * <p> * The cardinality of an element <code>e</code> in the returned collection is the same as the cardinality of <code>e</code> in * <code>collection</code> unless <code>remove</code> contains <code>e</code>, in which case the cardinality is zero. * </p> * * <p> * ? <span style="color:red">(???)</span>,?,? <code>collection</code>?,? * <code>collection.removeAll(remove);</code>. * </p> * * <p> * {@link ListUtils#removeAll(Collection, Collection)},?<code>removeElement</code> list. * </p> * * @param <O> * the generic type * @param objectCollection * the collection from which items are removed (in the returned collection) * @param removeCollection * the items to be removed from the returned <code>collection</code> * @return <code>objectCollection</code> null, {@link NullPointerException}<br> * @see ListUtils#removeAll(Collection, Collection) * @since Commons Collections 4 * @since 1.0.8 */ public static <O> List<O> removeAll(Collection<O> objectCollection, Collection<O> removeCollection) { Validate.notNull(objectCollection, "objectCollection can't be null!"); return ListUtils.removeAll(objectCollection, removeCollection); }