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.samskivert.depot.clause.Where.java

public Where(SQLExpression<?> condition1, SQLExpression<?>... andConditions) {
    _condition = Ops.and(Lists.asList(condition1, andConditions));
}

From source file:org.alkemy.parse.NodeFactory.java

/**
 * if {@link #isCollection()}, then adds the values to it.
 * //  w  w w  .j  av  a  2s .  co m
 * @throws AccessException
 *             If an error occurs while adding the values.
 */
@SuppressWarnings("unchecked")
default <E> void addAll(Object parent, E first, E... others) throws AlkemyException {
    addAll(parent, Lists.asList(first, others));
}

From source file:org.jboss.hal.core.mbui.form.OperationFormBuilder.java

public OperationFormBuilder<T> include(@NonNls String first, @NonNls String... rest) {
    includes.addAll(Lists.asList(first, rest));
    return this;
}

From source file:org.eclipse.incquery.runtime.localsearch.operations.extend.IterateOverEDatatypeInstances.java

@Override
public List<Integer> getVariablePositions() {
    return Lists.asList(position, new Integer[0]);
}

From source file:com.palantir.common.collect.IterableView.java

public IterableView<T> concat(Iterable<? extends T>... inputs) {
    return of(Iterables.concat(Lists.asList(delegate(), inputs)));
}

From source file:com.google.caliper.runner.instrument.JarFinder.java

/**
 * Returns a list of jar files reachable from the given class loaders.
 *
 * <p><b>Warning:</b> Current limitations:
 *
 * <ul>/*from   w  ww  .ja  v  a2s. com*/
 *   <li>Looks only for files and JARs in URLs available from {@link URLClassLoader} instances or
 *       the {@linkplain ClassLoader#getSystemClassLoader() system class loader}.
 *   <li>Only understands {@code file:} URLs.
 * </ul>
 *
 * @throws IOException if the attempt to read class path resources (jar files or directories)
 *     failed.
 */
public static ImmutableSet<File> findJarFiles(ClassLoader first, ClassLoader... rest) throws IOException {
    Scanner scanner = new Scanner();
    Map<File, ClassLoader> map = Maps.newLinkedHashMap();
    for (ClassLoader classLoader : Lists.asList(first, rest)) {
        map.putAll(getClassPathEntries(classLoader));
    }
    for (Map.Entry<File, ClassLoader> entry : map.entrySet()) {
        scanner.scan(entry.getKey(), entry.getValue());
    }
    return scanner.jarFiles();
}

From source file:com.b2international.commons.concurrent.equinox.ForkJoinUtils.java

public static void runInParallel(final Runnable firstRunnable, final Runnable... restRunnables) {
    runInParallel(Lists.asList(firstRunnable, restRunnables));
}

From source file:com.yahoo.yqlplus.engine.internal.bytecode.types.gambit.BytecodeCatchBuilder.java

@Override
public ScopedBuilder on(String varName, TypeWidget exceptionType, TypeWidget... moreExceptionTypes) {
    CatchClause catchClause = new CatchClause(source, parent.child());
    for (TypeWidget t : Lists.asList(exceptionType, moreExceptionTypes)) {
        catchClause.exceptionInternalNames.add(t.getJVMType().getInternalName());
        exceptionType = source.getValueTypeAdapter().unifyTypes(exceptionType, t);
    }//from   w ww  . j a v  a 2  s.  c  o  m
    AssignableValue local = catchClause.allocate(varName, exceptionType);
    catchClause.body.add(local.write(exceptionType));
    catchClauses.add(catchClause);
    return catchClause;
}

From source file:uk.co.flax.luwak.assertions.MatchesAssert.java

public MatchesAssert selectedQueries(String queryId, String... queryIds) {
    Assertions.assertThat(actual.getPresearcherHits().containsAll(Lists.asList(queryId, queryIds)));
    return this;
}

From source file:com.palantir.giraffe.file.base.BaseFileSystem.java

@Override
public P getPath(String first, String... more) {
    if (more.length == 0) {
        return getPath(first);
    } else {/*from  w w w . ja v  a2 s.co m*/
        return getPath(Joiner.on(getSeparator()).join(Lists.asList(first, more)));
    }
}