Java List Merge mergeLists(List dest, List inserts)

Here you can find the source of mergeLists(List dest, List inserts)

Description

merge Lists

License

Open Source License

Declaration

public static <T> void mergeLists(List<T> dest, List<T> inserts) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2014 Karlsruhe Institute of Technology, Germany
 *                    Technical University Darmstadt, Germany
 *                    Chalmers University of Technology, Sweden
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors://from  www . j ava2s. c  o m
 *    Technical University Darmstadt - initial API and implementation and/or initial documentation
 *******************************************************************************/

import java.util.List;

public class Main {
    public static <T> void mergeLists(List<T> dest, List<T> inserts) { // TODO: Move to CollectionUtil
        for (T t : inserts) {
            if (!dest.contains(t)) {
                dest.add(t);
            }
        }
    }
}

Related

  1. mergeList(List list, List... others)
  2. mergeListNoDuplicate(List one, List two)
  3. mergeLists(final T... array)
  4. mergeLists(List baseList, List newItems)
  5. mergeLists(List copyTo, List copyFrom)
  6. mergeLists(List listA, List listB, List listC)
  7. mergeLists(Object oldValue, Object newValue, Object newValue2)
  8. mergeOperations(List> list1, Set ops2)
  9. mergeOrdered( List base, List elems)