Java Collection Add addAll(Collection left, Collection right)

Here you can find the source of addAll(Collection left, Collection right)

Description

Add all from right to left collection

License

Open Source License

Declaration

public static <T> void addAll(Collection<T> left, Collection<T> right) 

Method Source Code

//package com.java2s;
/*//from  w  ww . j a v  a  2s .  c  om
 * Copyright Siemens AG, 2014-2016.
 * With modifications by Bosch Software Innovations GmbH, 2016
 * Part of the SW360 Portal Project.
 *
 * SPDX-License-Identifier: EPL-1.0
 *
 * 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
 */

import java.util.*;

public class Main {
    /**
     * Add all from right to left collection
     */
    public static <T> void addAll(Collection<T> left, Collection<T> right) {
        if (left != null && right != null) {
            left.addAll(right);
        }
    }
}

Related

  1. addAll(Collection collection, T[] items)
  2. addAll(Collection dest, Collection src, Class type)
  3. addAll(Collection dest, Collection orig)
  4. addAll(Collection dest, T... elements)
  5. addAll(Collection intoCollection, Collection fromCollection)
  6. addAll(Collection t1, Iterable t2)
  7. addAll(Collection target, Collection source)
  8. addAll(Collection target, Iterable source)
  9. addAll(Collection target, S[] source)