Example usage for java.util Collections addAll

List of usage examples for java.util Collections addAll

Introduction

In this page you can find the example usage for java.util Collections addAll.

Prototype

@SafeVarargs
public static <T> boolean addAll(Collection<? super T> c, T... elements) 

Source Link

Document

Adds all of the specified elements to the specified collection.

Usage

From source file:com.omnigon.aem.common.utils.url.DefaultSlingUrlBuilder.java

DefaultSlingUrlBuilder(final RequestPathInfo pathInfo) {
    this.contentPath = pathInfo.getResourcePath();
    Collections.addAll(this.selectors, pathInfo.getSelectors());
    this.extension = StringUtils.defaultIfBlank(pathInfo.getExtension(), HTML_EXTENSION);
    this.suffix = pathInfo.getSuffix();
}

From source file:Main.java

/**
 * <p>//from   ww  w.  j a  va 2 s  . c om
 * Returns a {@code List} with a initial capacity which equals to the number of
 * elements given in parameter and with those elements already added.
 * </p>
 *
 * @param elements the elements to add to the list to create
 * @param <T> the generic of the list
 * @return the creates {@code List}
 */
public static <T> List<T> newList(final T... elements) {
    final List<T> retval = new ArrayList<T>(elements.length);
    Collections.addAll(retval, elements);
    return retval;
}

From source file:end2endtests.runner.ServerRunner.java

public void addJvmOptions(String... options) {
    Collections.addAll(jvmOptions, options);
}

From source file:com.drtshock.playervaults.vaultmanagement.Serialization.java

public static List<String> toString(ItemStack[] itemsLeft) {
    List<String> result = new ArrayList<>();
    List<ConfigurationSerializable> items = new ArrayList<>();
    Collections.addAll(items, itemsLeft);
    for (ConfigurationSerializable cs : items) {
        if (cs == null) {
            result.add("null");
        } else {/*from   w ww.j  av  a  2  s .c  om*/
            result.add(new JSONObject(serialize(cs)).toString());
        }
    }
    return result;
}

From source file:Main.java

/**
 * Utility for adding an array to a collection.
 *
 * @param t1 The collection to add to/*  w  ww.  j  a  v a2  s  . c  o  m*/
 * @param t2 The iterable to add each item of to the collection
 * @param <T> The element type of t1
 * @return t1
 */
public static <T> Collection<T> addAll(Collection<T> t1, T... t2) {
    Collections.addAll(t1, t2);
    return t1;
}

From source file:io.fabric8.vertx.maven.plugin.components.impl.GroovyExtensionCombiner.java

private static void append(String entry, List<String> list) {
    if (entry != null) {
        Collections.addAll(list, entry.split("\\s*,\\s*"));
    }/*w  ww  . j av a2  s  .  c o  m*/
}

From source file:com.dsh105.commodus.config.Option.java

public Option(FileConfiguration configuration, String path, String... comments) {
    this.config = configuration;
    this.path = path;

    ArrayList<String> commentsList = new ArrayList<>();
    for (String comment : comments) {
        Collections.addAll(commentsList, WordUtils.wrap(comment, 30, "\n", false).split("\n"));
    }/*from  w  w w .  j  a  v  a 2s  .  co m*/
    this.comments = commentsList.toArray(new String[commentsList.size()]);
}

From source file:com.mycsense.carbondb.domain.Dimension.java

public Dimension(Keyword... pKeywords) {
    this();
    Collections.addAll(keywords, pKeywords);
}

From source file:org.arrow.runtime.mapper.AppendMessageMapper.java

/**
 * {@inheritDoc}/*from w ww.j a  v a 2s  .  c  o  m*/
 */
@Override
public Iterable<EventMessage> apply(Iterable<EventMessage> parameter) {
    Iterator<EventMessage> iterator = parameter.iterator();
    List<EventMessage> list = IteratorUtil.asList(iterator);

    Collections.addAll(list, messages);
    return list;
}

From source file:com.netflix.spinnaker.clouddriver.kubernetes.v2.validator.KubernetesValidationUtil.java

private String joinAttributeChain(String... attributes) {
    List<String> chain = new ArrayList<>();
    chain.add(context);/* w ww.ja v a2s. com*/
    Collections.addAll(chain, attributes);
    return String.join(".", chain);
}