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, K k4, V v4) 

Source Link

Usage

From source file:co.cask.cdap.common.metrics.MetricsTags.java

public static Map<String, String> flowlet(Id.Program flowId, String flowletId) {
    return ImmutableMap.of(Constants.Metrics.Tag.NAMESPACE, flowId.getNamespaceId(), Constants.Metrics.Tag.APP,
            flowId.getApplicationId(), Constants.Metrics.Tag.FLOW, flowId.getId(),
            Constants.Metrics.Tag.FLOWLET, flowletId);
}

From source file:co.cask.cdap.common.metrics.MetricsContexts.java

public static Map<String, String> forFlowlet(Id.Program flowId, String flowletId) {
    return ImmutableMap.of(Constants.Metrics.Tag.NAMESPACE, flowId.getNamespaceId(), Constants.Metrics.Tag.APP,
            flowId.getApplicationId(), Constants.Metrics.Tag.FLOW, flowId.getId(),
            Constants.Metrics.Tag.FLOWLET, flowletId);
}

From source file:com.android.build.gradle.integration.common.utils.NdkHelper.java

/** Gets the maximum platform version supported by the specified ndk directory. */
public static int getMaxPlatformSupported(File ndkDir) {
    Revision ndkRevision = NdkHandler.findRevision(ndkDir);
    int major = ndkRevision != null ? ndkRevision.getMajor() : 10;
    // for r10 max platform is 21, r11 max is 24, r12 max platform is 24
    ImmutableMap<Integer, Integer> perVersion = ImmutableMap.of(10, 21, 11, 24, 12, 24, 13, 24);
    return perVersion.get(major);
}

From source file:org.sakaiproject.nakamura.lite.jdbc.derby.DerbySetup.java

private synchronized static JDBCStorageClientPool createClientPool(Configuration configuration) {
    try {/*www  . j a  v  a 2 s. com*/
        JDBCStorageClientPool connectionPool = new JDBCStorageClientPool();
        connectionPool.activate(ImmutableMap.of(JDBCStorageClientPool.CONNECTION_URL,
                (Object) "jdbc:derby:memory:MyDB;create=true", JDBCStorageClientPool.JDBC_DRIVER,
                "org.apache.derby.jdbc.EmbeddedDriver", "store-base-dir", "target/store",
                Configuration.class.getName(), configuration));
        return connectionPool;
    } catch (ClassNotFoundException e) {
        throw new RuntimeException(e.getMessage(), e);
    }
}

From source file:com.spotify.metrics.remote.SemanticAggregator.java

public static Map<String, Object> buildDocument(String value, String key, Map<String, String> allAttributes) {
    return ImmutableMap.of("type", "metric", "value", value, "key", key, "attributes", allAttributes);
}

From source file:com.github.epheatt.kafka.connect.morphlines.Records.java

static MapTestCase map() {
    MapTestCase testCase = new MapTestCase();

    testCase.map = ImmutableMap.of("firstName", "example", "lastName", "user", "email",
            "example.user@example.com", "age", 27);
    testCase.record = new SinkRecord("testing", 1, null, null, null, testCase.map, 1L, 1484897702123L,
            TimestampType.CREATE_TIME);//w  w  w  .  ja va 2 s .  c o  m

    return testCase;
}

From source file:co.cask.cdap.common.metrics.MetricsTags.java

public static Map<String, String> serviceHandler(Id.Program id, String handlerId) {
    return ImmutableMap.of(Constants.Metrics.Tag.NAMESPACE, id.getNamespaceId(), Constants.Metrics.Tag.APP,
            id.getApplicationId(), Constants.Metrics.Tag.SERVICE, id.getId(), Constants.Metrics.Tag.HANDLER,
            handlerId);/*from  ww  w  . j  a va  2s . c  o  m*/
}

From source file:co.cask.cdap.common.metrics.MetricsContexts.java

public static Map<String, String> forServiceHandler(Id.Program id, String handlerId) {
    return ImmutableMap.of(Constants.Metrics.Tag.NAMESPACE, id.getNamespaceId(), Constants.Metrics.Tag.APP,
            id.getApplicationId(), Constants.Metrics.Tag.SERVICE, id.getId(), Constants.Metrics.Tag.HANDLER,
            handlerId);//from  w  ww .j a  va  2  s. c o m
}

From source file:org.apache.beam.sdk.io.common.FileBasedIOITHelper.java

public static String getExpectedHashForLineCount(int lineCount) {
    Map<Integer, String> expectedHashes = ImmutableMap.of(1000, "8604c70b43405ef9803cb49b77235ea2", 100_000,
            "4c8bb3b99dcc59459b20fefba400d446", 1_000_000, "9796db06e7a7960f974d5a91164afff1", 100_000_000,
            "6ce05f456e2fdc846ded2abd0ec1de95");

    return getHashForRecordCount(lineCount, expectedHashes);
}

From source file:org.envirocar.server.rest.guice.JerseyModule.java

public static Map<String, String> getContainerFilterConfig() {
    return ImmutableMap.of(ResourceConfig.FEATURE_DISABLE_WADL, TRUE,
            ResourceConfig.PROPERTY_CONTAINER_REQUEST_FILTERS,
            classList(GZIPContentEncodingFilter.class, AuthenticationFilter.class),
            ResourceConfig.PROPERTY_CONTAINER_RESPONSE_FILTERS,
            classList(PaginationFilter.class, GZIPContentEncodingFilter.class),
            ResourceConfig.PROPERTY_RESOURCE_FILTER_FACTORIES,
            classList(AuthenticationResourceFilterFactory.class, JSONSchemaResourceFilterFactory.class));
}