Example usage for com.google.common.collect Lists asList

List of usage examples for com.google.common.collect Lists asList

Introduction

In this page you can find the example usage for com.google.common.collect Lists asList.

Prototype

public static <E> List<E> asList(@Nullable E first, E[] rest) 

Source Link

Document

Returns an unmodifiable list containing the specified first element and backed by the specified array of additional elements.

Usage

From source file:com.thinkbiganalytics.metadata.rest.model.sla.ServiceLevelAgreement.java

public void setGroups(List<ObligationGroup> groups) {
    this.defaultGroup.getObligations().clear();
    this.groups = Lists.asList(this.defaultGroup, groups.toArray(new ObligationGroup[groups.size()]));
}

From source file:eu.numberfour.n4js.ui.workingsets.WorkingSetManager.java

/**
 * Sugar for {@link #select(Iterable)}. Marks the selected working sets to be visible.
 *
 * @param first//from   www .j a va2 s  .c  o m
 *            the first working set to be marked as selected.
 * @param others
 *            other optional working sets to be marked as visible.
 */
default void select(final WorkingSet first, final WorkingSet... others) {
    select(Lists.asList(first, others));
}

From source file:com.google.jimfs.Options.java

/**
 * Returns an immutable set of the given options for a move.
 *//*from w w  w  .j  a v  a 2s .co m*/
public static ImmutableSet<CopyOption> getMoveOptions(CopyOption... options) {
    return ImmutableSet.copyOf(Lists.asList(LinkOption.NOFOLLOW_LINKS, options));
}

From source file:com.b2international.snowowl.core.request.SearchResourceRequestBuilder.java

/**
 * Sorts the result set by the given sort fields.
 * //from  w w  w . ja  va  2 s.co  m
 * @param first - the first sort field
 * @param rest - any remaining sort fields (optional)
 * @return this builder instance
 */
public final B sortBy(Sort first, Sort... rest) {
    return sortBy(Lists.asList(first, rest));
}

From source file:org.obiba.mica.dataset.search.rest.harmonization.CsvContingencyWriter.java

private void writeContingencyCategorical(CSVWriter writer, Mica.DatasetVariableContingencyDto c,
        List<String> values, List<String> terms) {
    List<List<Integer>> tmp = ContingencyUtils.getCategoricalRows(c, values, terms);

    IntStream.range(0, values.size())
            .forEach(i -> writer/* w ww  .  ja va2 s. c  o m*/
                    .writeNext(Lists.asList(values.get(i), tmp.get(i).stream().map(x -> x.toString()).toArray())
                            .toArray(new String[0])));

    writer.writeNext(Lists.asList("Total", tmp.get(tmp.size() - 1).stream().map(x -> x.toString()).toArray())
            .stream().toArray(String[]::new));
}

From source file:com.opengamma.strata.market.curve.CurveGroupDefinitionBuilder.java

/**
 * Adds the definition of a discount curve to the curve group definition.
 *
 * @param curveDefinition  the discount curve configuration
 * @param otherCurrencies  additional currencies for which the curve can provide discount factors
 * @param currency  the currency for which the curve provides discount rates
 * @return this builder//from w w w. ja  v  a2 s . c  o m
 */
public CurveGroupDefinitionBuilder addDiscountCurve(NodalCurveDefinition curveDefinition, Currency currency,
        Currency... otherCurrencies) {

    ArgChecker.notNull(curveDefinition, "curveDefinition");
    ArgChecker.notNull(currency, "currency");
    CurveGroupEntry entry = CurveGroupEntry.builder().curveName(curveDefinition.getName())
            .discountCurrencies(ImmutableSet.copyOf(Lists.asList(currency, otherCurrencies))).build();
    return merge(entry, curveDefinition);
}

From source file:com.b2international.snowowl.datastore.server.oplock.AbstractOperationLockManager.java

@Override
public void unlock(final C context, final IOperationLockTarget firstTarget,
        final IOperationLockTarget... restTargets) throws OperationLockException {
    unlock(context, Lists.asList(firstTarget, restTargets));
}

From source file:org.sonar.db.component.SnapshotDao.java

public void insert(DbSession session, SnapshotDto item, SnapshotDto... others) {
    insert(session, Lists.asList(item, others));
}

From source file:se.softhouse.common.testlib.Launcher.java

/**
 * Runs {@code program} with {@code programArguments} as arguments. This method
 * will wait until program execution has finished.
 * /*from   w  ww. j  a v  a2 s.c  o m*/
 * @param program the executable to run
 * @param programArguments optional arguments to pass to the program
 * @return output/errors from the executed program
 * @throws IOException if an I/O error occurs while starting {@code program}
 * @throws InterruptedException if the thread starting the program is
 *             {@link Thread#interrupted()} while waiting for the program to finish
 * @throws SecurityException if {@link SecurityManager#checkExec checkExec} fails
 */
public static LaunchedProgram launch(String program, String... programArguments)
        throws IOException, InterruptedException {
    return execute(Lists.asList(program, programArguments), "Failed to launch " + program);
}

From source file:org.obiba.mica.dataset.search.rest.harmonization.CsvContingencyWriter.java

private void writeContingencyContinuous(CSVWriter writer, Mica.DatasetVariableContingencyDto c,
        List<String> terms) {
    List<List<Number>> table = ContingencyUtils.getContinuousRows(c, terms);
    List<String> values = Lists.newArrayList("Min", "Max", "Mean", "Std", "N");

    IntStream.range(0, values.size())
            .forEach(i -> writer.writeNext(
                    Lists.asList(values.get(i), table.get(i).stream().map(x -> x.toString()).toArray()).stream()
                            .toArray(String[]::new)));
}