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

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

Introduction

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

Prototype

public static <K, V> ImmutableMap<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3) 

Source Link

Usage

From source file:io.prestosql.plugin.cassandra.CassandraQueryRunner.java

public static synchronized DistributedQueryRunner createCassandraQueryRunner() throws Exception {
    EmbeddedCassandra.start();//from   w w w . j  a  v  a2 s.c  o m

    DistributedQueryRunner queryRunner = new DistributedQueryRunner(createCassandraSession("tpch"), 4);

    queryRunner.installPlugin(new TpchPlugin());
    queryRunner.createCatalog("tpch", "tpch");

    queryRunner.installPlugin(new CassandraPlugin());
    queryRunner.createCatalog("cassandra", "cassandra",
            ImmutableMap.of("cassandra.contact-points", EmbeddedCassandra.getHost(),
                    "cassandra.native-protocol-port", Integer.toString(EmbeddedCassandra.getPort()),
                    "cassandra.allow-drop-table", "true"));

    if (!tpchLoaded) {
        createKeyspace(EmbeddedCassandra.getSession(), "tpch");
        List<TpchTable<?>> tables = TpchTable.getTables();
        copyTpchTables(queryRunner, "tpch", TINY_SCHEMA_NAME, createCassandraSession("tpch"), tables);
        for (TpchTable table : tables) {
            EmbeddedCassandra.refreshSizeEstimates("tpch", table.getTableName());
        }
        tpchLoaded = true;
    }

    return queryRunner;
}

From source file:ninja.leaping.permissionsex.command.PermissionsCommands.java

public static CommandElement permissionValue(Translatable key) {
    return firstParsing(integer(key), bool(key),
            choices(key, ImmutableMap.of("none", 0, "null", 0, "unset", 0)));
}

From source file:org.eclipse.che.wsagent.server.SwaggerServletModule.java

@Override
protected void configureServlets() {
    bind(io.swagger.jaxrs.config.DefaultJaxrsConfig.class).asEagerSingleton();
    install(new org.eclipse.che.swagger.deploy.DocsModule());
    serve("/swaggerinit").with(io.swagger.jaxrs.config.DefaultJaxrsConfig.class, ImmutableMap.of("api.version",
            "1.0", "swagger.api.title", "Eclipse Che", "swagger.api.basepath", "/api"));
}

From source file:com.github.jcustenborder.kafka.connect.cdc.Change.java

static Map<String, Object> sourcePartition(ChangeKey change) {
    Preconditions.checkNotNull(change, "change cannot be null.");
    return ImmutableMap.of(Constants.DATABASE_NAME_VARIABLE, change.databaseName,
            Constants.SCHEMA_NAME_VARIABLE, change.schemaName, Constants.TABLE_NAME_VARIABLE, change.tableName);
}

From source file:org.codice.ddf.graphql.FunctionDataFetcherException.java

private static Map<String, Object> toMap(String functionName, List<Object> args,
        List<ErrorMessage> customMessage) {
    return ImmutableMap.of("functionName", functionName, "args", args, "errors", customMessage);
}

From source file:org.eclipse.che.swagger.deploy.BasicSwaggerConfigurationModule.java

@Override
protected void configureServlets() {
    bind(io.swagger.jaxrs.config.DefaultJaxrsConfig.class).asEagerSingleton();
    serve("/swaggerinit").with(io.swagger.jaxrs.config.DefaultJaxrsConfig.class, ImmutableMap.of("api.version",
            "1.0", "swagger.api.title", "Eclipse Che", "swagger.api.basepath", "/api"));
}

From source file:forms.meta.MetaMap.java

/** Returns a MetaMap containing the given mappings. */
public static <T, U, V> MetaMap of(MetaField<T> tVar, T tVal, MetaField<U> uVar, U uVal, MetaField<V> vVar,
        V vVal) {//from   w w  w  .j a v  a  2 s  . c  o m
    return new MetaMap(ImmutableMap.of(tVar, tVal, uVar, uVal, vVar, vVal));
}

From source file:org.openqa.selenium.ie.InternetExplorerElement.java

@Override
protected WebElement findElement(String using, String value) {
    Response response = execute(DriverCommand.FIND_CHILD_ELEMENT,
            ImmutableMap.of("id", id, "using", using, "value", value));
    return (WebElement) response.getValue();
}

From source file:com.atlassian.jira.help.AnalyticsHelpUrlBuilder.java

@Nonnull
@Override//from  w  ww . j  a  v  a  2  s .c  om
Map<String, String> getExtraParameters() {
    final String licenseType = getLicenseType();
    if (licenseType != null) {
        return ImmutableMap.of("utm_campaign", licenseType, "utm_medium", "navbar", "utm_source", "inproduct");
    } else {
        return ImmutableMap.of();
    }
}

From source file:org.trustedanalytics.servicebroker.hdfs.plans.HdfsPlanTestBase.java

Credentials getInputCredentials() {
    //@formatter:off
    return new Credentials(
            ImmutableMap.of("key1", ImmutableMap.of("innerKey1", "innerValue1", "innerKey2", "innerValue2"),
                    "key2", "value2", "fs.defaultFS", "hdfs://name1"));
    //@formatter:on
}