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:edu.ku.brc.specify.dbsupport.customqueries.CustomStatQueries.java

@Override
public List<Integer> getTableIds() {
    Vector<Integer> list = new Vector<Integer>();
    switch (type) {
    case CatalogedLast7Days:
    case CatalogedLast30Days:
    case CatalogedLastYear:
        Collections.addAll(list, new Integer[] { 1 });
        break;/*from w ww .jav a  2s  .co m*/

    case OverdueLoans:
        Collections.addAll(list, new Integer[] { 52 });
    }
    return list;
}

From source file:de.Keyle.MyPet.api.util.inventory.IconMenuItem.java

public IconMenuItem addLoreLine(String line) {
    Validate.notNull(line, "Lore line cannot be null");
    if (line.contains("\n")) {
        Collections.addAll(this.lore, line.split("\n"));
    } else {/*from ww w.  j  a  v a 2s.  co  m*/
        this.lore.add(line);
    }
    hasChanged = true;
    return this;
}

From source file:edu.ku.brc.specify.dbsupport.customqueries.CatalogedByYearCustomQuery.java

@Override
public List<Integer> getTableIds() {
    Vector<Integer> list = new Vector<Integer>();
    Collections.addAll(list, new Integer[] { 1 });
    return list;/* w w  w.  j  a  v a2s.  c o  m*/
}

From source file:com.codeabovelab.dm.cluman.configs.container.PropertiesParser.java

private List<String> parseList(String value) {
    List<String> list = new ArrayList<>();
    String[] split = value.split(",");
    Collections.addAll(list, split);
    return list;//from  www  . ja v  a  2s . com
}

From source file:edu.kit.dama.staging.adapters.DefaultIngestInformationServiceAdapter.java

@Override
public List<IngestInformation> getIngestsForArchiving(IAuthorizationContext pContext)
        throws ServiceAdapterException {
    LOGGER.debug("Getting all ingests ready for staging");
    List<IngestInformation> result = new LinkedList<IngestInformation>();
    List<IngestInformation> queryResult = IngestInformationServiceLocal.getSingleton()
            .getIngestInformationByStatus(INGEST_STATUS.PRE_INGEST_FINISHED.getId(), 0, Integer.MAX_VALUE,
                    pContext);/*from ww  w .  j  a  v a 2 s  .co  m*/
    if (queryResult != null) {
        LOGGER.debug("Query for archivable ingests returned '{}' results", queryResult.size());
        Collections.addAll(result, queryResult.toArray(new IngestInformation[queryResult.size()]));
    } else {
        LOGGER.debug("Query for archivable ingests returned no result");
    }
    return result;
}

From source file:com.exzogeni.dk.http.HttpTask.java

@NonNull
public HttpTask<V> addHeader(@NonNull String key, @NonNull String... values) {
    List<String> headers = mHeaders.get(key);
    if (headers == null) {
        headers = new CopyOnWriteArrayList<>();
        mHeaders.put(key, headers);/*from   ww w  . j ava  2  s . com*/
    }
    headers.clear();
    Collections.addAll(headers, values);
    return this;
}

From source file:nc.noumea.mairie.appock.viewmodel.ListeDemandeViewModel.java

public List<EtatDemande> getListeEtatDemande() {
    List<EtatDemande> result = new ArrayList<>();
    result.add(null);//from w ww.  j av a2  s .  c  o  m
    Collections.addAll(result, EtatDemande.values());

    return result;
}

From source file:lodsve.core.condition.OnClassCondition.java

private void addAll(List<String> list, List<Object> itemsToAdd) {
    if (itemsToAdd != null) {
        for (Object item : itemsToAdd) {
            Collections.addAll(list, (String[]) item);
        }/*from  ww  w .  ja va  2 s  .  c  o  m*/
    }
}

From source file:com.hi.datacleaner.ExternalCommandTransformer.java

List<String> getCommandTokens(InputRow inputRow) {
    final List<String> commandTokens = new ArrayList<>();
    final String parametersPart = getParametersPart(inputRow);

    if (_command.contains(ARGUMENTS_PLACEHOLDER)) {
        final String completeCommand = _command.replace(ARGUMENTS_PLACEHOLDER, parametersPart);
        Collections.addAll(commandTokens, completeCommand.split(" "));
    } else {/*from w  ww  . j a v a2 s . c  o  m*/
        Collections.addAll(commandTokens, _command.split(" "));

        if (parametersPart.length() > 0) {
            Collections.addAll(commandTokens, parametersPart.split(INTERNAL_SEPARATOR));
        }
    }

    return commandTokens;
}

From source file:de.tor.tribes.util.VillageUtils.java

public static Village[] getVillagesByContinent(Village[] pVillages, final Integer[] pContinents,
        Comparator<Village> pComparator) {
    if (pContinents == null || pContinents.length == 0) {
        return pVillages;
    }// w  w w. ja  v a2s  . com
    List<Village> villages = new LinkedList<>();
    Collections.addAll(villages, pVillages);

    CollectionUtils.filter(villages, new Predicate() {

        @Override
        public boolean evaluate(Object o) {
            return ArrayUtils.contains(pContinents, ((Village) o).getContinent());
        }
    });
    if (pComparator != null) {
        Collections.sort(villages, pComparator);
    }
    return villages.toArray(new Village[villages.size()]);
}