Example usage for com.google.common.collect ImmutableList of

List of usage examples for com.google.common.collect ImmutableList of

Introduction

In this page you can find the example usage for com.google.common.collect ImmutableList of.

Prototype

@SuppressWarnings("unchecked")
    public static <E> ImmutableList<E> of() 

Source Link

Usage

From source file:io.prestosql.sql.planner.iterative.rule.DesugarCurrentUser.java

public static FunctionCall getCall(CurrentUser node) {
    return new FunctionCall(QualifiedName.of("$current_user"), ImmutableList.of());
}

From source file:com.bennavetta.aeneas.mesos.slave.docker.Docker.java

/**
 * If necessary, attempt to launch a Docker daemon.
 * @return {@code true} if a Docker daemon exists or was started, {@code false} if no Docker daemon could be obtained
 *///from  w ww  . j av  a  2s.c  om
public static boolean startDocker() {
    if (socketExists()) {
        LOG.debug("Found existing Docker socket");
    } else {
        try {
            LOG.debug("Launching Docker daemon");
            Daemon.launchDaemon(ImmutableList.of());

            LOG.debug("Waiting for daemon to start");
            Thread.sleep(15000);
        } catch (IOException e) {
            LOG.error("Unable to start Docker daemon", e);
            return false;
        } catch (InterruptedException e) {
            throw Throwables.propagate(e);
        }
    }
    return true;
}

From source file:com.spotify.heroic.metadata.WriteMetadata.java

private static WriteMetadata of(final long time) {
    return new WriteMetadata(ImmutableList.of(), ImmutableList.of(time));
}

From source file:org.apache.james.eventsourcing.eventstore.History.java

public static History empty() {
    return new History(ImmutableList.of());
}

From source file:org.apache.james.mailbox.cassandra.mail.utils.FlagsUpdateStageResult.java

public static FlagsUpdateStageResult success(UpdatedFlags updatedFlags) {
    return new FlagsUpdateStageResult(ImmutableList.of(), ImmutableList.of(updatedFlags));
}

From source file:com.facebook.buck.util.MoreIterables.java

/**
 * Combine the given iterables by peeling off items one at a time from each of the input
 * iterables until any one of the iterables are exhausted.
 *//*from w w w.  ja va2s. c om*/
@SafeVarargs
public static <T> Iterable<T> zipAndConcat(Iterable<T>... inputs) {

    // If no inputs were seen, just return an empty list.
    if (inputs.length == 0) {
        return ImmutableList.of();
    }

    ImmutableList.Builder<T> result = ImmutableList.builder();
    ImmutableList<Iterator<T>> iterators = iterators(inputs);

    // Keep grabbing rounds from the input iterators until we've exhausted one
    // of them, then return.
    List<T> round = Lists.newArrayListWithCapacity(inputs.length);
    while (true) {
        for (Iterator<T> iterator : iterators) {
            if (!iterator.hasNext()) {
                return result.build();
            }
            round.add(iterator.next());
        }
        result.addAll(round);
        round.clear();
    }
}

From source file:com.facebook.presto.sql.planner.iterative.rule.DesugarCurrentPath.java

public static FunctionCall getCall(CurrentPath node) {
    return new FunctionCall(QualifiedName.of("$current_path"), ImmutableList.of());
}

From source file:net.lyonlancer5.mcmp.kawo.modes.BookProcessor.java

public static List<Pair<String, String>> readBook(ItemStack book) {
    if (book.getTagCompound() == null) {
        return ImmutableList.of();
    }// w  w w  . j  a  v  a  2  s. c  o m

    NBTTagList pages = book.getTagCompound().getTagList("pages", 8);

    if (pages == null || pages.tagCount() == 0) {
        return ImmutableList.of();
    }

    final List<Pair<String, String>> lines = Lists.newArrayList();
    for (int i = 0; i < pages.tagCount(); i++) {
        String[] crlf = pages.getStringTagAt(i).split("[\\r\\n]");
        for (String ln : crlf) {
            ln = ln.trim();
            if (!ln.isEmpty()) {
                if (ln.contains("=")) {
                    String[] var0 = ln.split("=", 2);
                    lines.add(Pair.of(var0[0].trim(), var0[1].trim()));
                }
            }
        }
    }
    return ImmutableList.copyOf(lines);
}

From source file:com.spotify.heroic.metadata.FindKeys.java

public static FindKeys of() {
    return new FindKeys(ImmutableList.of(), ImmutableSet.of(), 0, 0);
}

From source file:com.spotify.heroic.metadata.CountSeries.java

public static CountSeries of(long count, boolean limited) {
    return new CountSeries(ImmutableList.of(), count, limited);
}