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

public static <E> ImmutableList<E> of(E e1, E e2) 

Source Link

Usage

From source file:com.google.devtools.build.android.desugar.testdata.java8.ConcreteDefaultInterfaceWithLambda.java

@Override
public List<String> digits() {
    return ImmutableList.of(0, 2).stream().map(i -> i == 0 ? ONE : String.valueOf(i))
            .collect(Collectors.toList());
}

From source file:com.querydsl.core.types.template.TimeTemplate.java

public static <T extends Comparable<?>> TimeTemplate<T> create(Class<T> type, String template, Object one,
        Object two) {/*from  ww  w .  j ava2s  . com*/
    return new TimeTemplate<T>(type, TemplateFactory.DEFAULT.create(template), ImmutableList.of(one, two));
}

From source file:com.wrmsr.wava.java.javac.option.TargetOption.java

@Override
public List<String> getArgs() {
    return ImmutableList.of("-target", String.format("1.%d", version));
}

From source file:com.wrmsr.wava.java.javac.option.SourceOption.java

@Override
public List<String> getArgs() {
    return ImmutableList.of("-source", String.format("1.%d", version));
}

From source file:com.google.errorprone.refaster.testdata.WildcardUnificationTemplateExample.java

public void example() {
    ImmutableList<String> actual = ImmutableList.of("kurt", "kluever");
    ImmutableList<String> expected = ImmutableList.of("kluever", "kurt");
    assertThat(actual).containsExactlyElementsIn(expected);

}

From source file:com.querydsl.core.types.template.DateTemplate.java

public static <T extends Comparable<?>> DateExpression<T> create(Class<T> type, String template, Object one,
        Object two) {/*from   w  w w  . j  a  v  a 2 s  . c  o  m*/
    return new DateTemplate<T>(type, TemplateFactory.DEFAULT.create(template), ImmutableList.of(one, two));
}

From source file:com.helion3.safeguard.commands.SafeGuardCommands.java

/**
 * Build a complete command hierarchy// w w  w  .j  a v  a 2 s .c om
 * @return
 */
public static CommandSpec getCommand() {
    ImmutableMap.Builder<List<String>, CommandCallable> builder = ImmutableMap.builder();
    builder.put(ImmutableList.of("pos", "position"), PositionCommand.getCommand());
    builder.put(ImmutableList.of("zone", "z"), ZoneCommands.getCommand());
    builder.put(ImmutableList.of("reload"), ReloadCommand.getCommand());
    builder.put(ImmutableList.of("?", "help"), HelpCommand.getCommand());

    return CommandSpec.builder().executor((src, args) -> {
        src.sendMessage(Text.of(Format.heading(TextColors.GRAY, "By ", TextColors.GOLD, "viveleroi.\n"),
                TextColors.GRAY, "Help: ", TextColors.WHITE, "/sg ?\n", TextColors.GRAY, "IRC: ",
                TextColors.WHITE, "irc.esper.net #helion3\n"));
        return CommandResult.empty();
    }).children(builder.build()).build();
}

From source file:com.facebook.buck.apple.simulator.AppleSimulatorDiscovery.java

/**
 * Discovers information about Apple simulators installed on the system.
 *//*from  w w  w  .  j av a  2s  .  c  o  m*/
public static ImmutableSet<AppleSimulator> discoverAppleSimulators(ProcessExecutor processExecutor,
        Path simctlPath) throws InterruptedException, IOException {
    LOG.debug("Running xcrun simctl list to get list of simulators");
    ProcessExecutorParams processExecutorParams = ProcessExecutorParams.builder()
            .setCommand(ImmutableList.of(simctlPath.toString(), "list")).build();
    ProcessExecutor.LaunchedProcess simctlListProcess = processExecutor.launchProcess(processExecutorParams);
    ImmutableSet.Builder<AppleSimulator> simulatorsBuilder = ImmutableSet.builder();

    try (InputStreamReader stdoutReader = new InputStreamReader(simctlListProcess.getInputStream(),
            StandardCharsets.UTF_8)) {
        LOG.debug("Parsing output of xcrun simctl list...");
        SimctlListOutputParsing.parseOutputFromReader(stdoutReader, simulatorsBuilder);
    }

    ProcessExecutor.Result result = processExecutor.waitForLaunchedProcess(simctlListProcess);
    if (result.getExitCode() != 0) {
        throw new IOException(result.getMessageForUnexpectedResult("simctl list"));
    }
    ImmutableSet<AppleSimulator> simulators = simulatorsBuilder.build();
    LOG.debug("Discovered simulators: %s", simulators);
    return simulators;
}

From source file:org.onosproject.cli.net.PortStateCompleter.java

@Override
protected List<String> choices() {
    return ImmutableList.of("enable", "disable");
}

From source file:io.crate.expression.scalar.geo.IntersectsFunction.java

private static FunctionInfo info(DataType type1, DataType type2) {
    return new FunctionInfo(new FunctionIdent(NAME, ImmutableList.of(type1, type2)), DataTypes.BOOLEAN);
}