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) 

Source Link

Usage

From source file:org.apache.druid.common.utils.ServletResourceUtils.java

/**
 * Converts String errorMsg into a Map so that it produces valid json on serialization into response.
 *///from  w  w  w  .ja  v a2s . com
public static Map<String, String> jsonize(String msgFormat, Object... args) {
    return ImmutableMap.of("error", StringUtils.nonStrictFormat(msgFormat, args));
}

From source file:org.apache.brooklyn.entity.database.mysql.MySqlClusterUtils.java

protected static Task<String> executeSqlOnNodeAsync(MySqlNode node, String commands) {
    return DynamicTasks.queue(Effectors.invocation(node, MySqlNode.EXECUTE_SCRIPT,
            ImmutableMap.of(CanExecuteScript.COMMANDS.getName(), commands))).asTask();
}

From source file:com.atlassian.jira.upgrade.tasks.UpgradeTask_Build6323.java

private void deletePluginState(String key) {
    getOfBizDelegator().removeByAnd("PluginState", ImmutableMap.of("key", key));
}

From source file:org.apache.james.jmap.model.mailbox.Quotas.java

public static Quotas from(QuotaId quotaId, Quota quota) {
    return new Quotas(ImmutableMap.of(quotaId, quota));
}

From source file:com.opengamma.strata.function.calculation.rate.MarketDataUtils.java

/**
 * Creates a rates provider from a set of market data containing a single discounting curve,
 * and forward curves and fixing series for a given set of indices.
 * All curves are overridden by a given replacement. 
 * //  w w w . j  ava  2 s  . c  om
 * @param marketData  the market data
 * @param currency  the currency of the discounting curve
 * @param indices  the indices
 * @param curveOverride  the curve override
 * @return the rates provider
 */
public static RatesProvider toSingleCurveRatesProvider(SingleCalculationMarketData marketData,
        Currency currency, Set<? extends Index> indices, NodalCurve curveOverride) {

    // TODO - we should be able to replace curves more easily than having to pick out all the
    // market data into a new rates provider.

    return ImmutableRatesProvider.builder().valuationDate(marketData.getValuationDate())
            .discountCurves(ImmutableMap.of(currency, curveOverride))
            .indexCurves(indices.stream().collect(toImmutableMap(Function.identity(), k -> curveOverride)))
            .timeSeries(indices.stream().collect(
                    toImmutableMap(Function.identity(), k -> marketData.getTimeSeries(IndexRateKey.of(k)))))
            .build();
}

From source file:com.github.tomakehurst.wiremock.extension.Parameters.java

public static Parameters one(String name, Object value) {
    return from(ImmutableMap.of(name, value));
}

From source file:org.scassandra.http.client.ErrorMessageConfig.java

@Override
Map<String, ?> getProperties() {
    return ImmutableMap.of(ErrorConstants.Message(), message);
}

From source file:org.openqa.selenium.grid.commands.DefaultHubConfig.java

DefaultHubConfig() {
    super(ImmutableMap.of("events",
            ImmutableMap.of("publish", "tcp://*:4442", "subscribe", "tcp://*:4443", "bind", true)));
}

From source file:org.openqa.selenium.grid.node.httpd.DefaultNodeConfig.java

DefaultNodeConfig() {
    super(ImmutableMap.of("events", ImmutableMap.of("publish", "tcp://*:4442", "subscribe", "tcp://*:4443")));
}

From source file:org.openqa.selenium.remote.DriverCommand.java

static CommandPayload NEW_SESSION(Capabilities capabilities) {
    return new CommandPayload(NEW_SESSION, ImmutableMap.of("desiredCapabilities", capabilities));
}