List of usage examples for com.google.common.collect ImmutableMap of
public static <K, V> ImmutableMap<K, V> of(K k1, V v1)
From source file:org.apache.shindig.social.opensocial.service.DataServiceServletFetcher.java
public Map<String, String> fetch(HttpServletRequest req) { return ImmutableMap.of(SecurityTokenDecoder.SECURITY_TOKEN_NAME, req.getParameter("st")); }
From source file:org.openqa.selenium.internal.selenesedriver.AbstractElementFinder.java
protected Map<String, String> newElement(String key) { String locator = "stored=" + urlEncode(key); return ImmutableMap.of("ELEMENT", locator); }
From source file:co.cask.cdap.api.metrics.NoopMetricsContext.java
@Override public MetricsContext childContext(String tagName, String tagValue) { return childContext(ImmutableMap.of(tagName, tagValue)); }
From source file:org.graylog2.plugin.database.ValidationException.java
public ValidationException(final String field, final String message) { super(message); this.errors = ImmutableMap.of(field, Collections.<ValidationResult>singletonList(new ValidationResult.ValidationFailed(message))); }
From source file:org.apache.druid.cli.convert.IndexCacheConverter.java
@Override public Map<String, String> convert(Properties properties) { final String value = properties.getProperty(PROPERTY); return ImmutableMap.of("druid.segmentCache.locations", StringUtils.format( "[{\"path\": \"%s\", \"maxSize\": %s}]", value, properties.getProperty("druid.server.maxSize"))); }
From source file:com.spotify.heroic.common.Statistics.java
public static Statistics of(String k1, long v1) { return new Statistics(ImmutableMap.of(k1, v1)); }
From source file:org.jclouds.cloudsigma.util.Servers.java
/** * Helper to create a small persistent server * //from ww w. ja v a 2 s . c om * @param name * what to name the server * @param driveUuuid * id of the boot drive * @param vncPassword * password for vnc * @param ip * static IP * @return a builder for a persistent 1Ghz 512m server with DHCP enabled network. */ public static Server.Builder smallWithStaticIP(String name, String driveUuuid, String vncPassword, String ip) { return new Server.Builder().name(name).cpu(1000).mem(512).persistent(true) .devices(ImmutableMap.of("ide:0:0", new IDEDevice.Builder(0, 0).uuid(driveUuuid).build())) .bootDeviceIds(ImmutableSet.of("ide:0:0")) .nics(ImmutableSet.of(new NIC.Builder().model(Model.E1000).dhcp(ip).build())) .vnc(new VNC(null, vncPassword, false)); }
From source file:com.google.devtools.build.lib.standalone.StandaloneActionContextConsumer.java
@Override public ImmutableMap<String, String> getSpawnActionContexts() { // This makes the "sandboxed" strategy the default Spawn strategy, unless it is overridden by a // later BlazeModule. return ImmutableMap.of("", "standalone"); }
From source file:org.apache.whirr.service.vblob.VBlobStatements.java
private static Statement writeConfigJson(VBlobConfig config) { Map<Object, Object> configJ = ImmutableMap.builder() .put("drivers", ImmutableList.builder() .add(ImmutableMap.of("fs-1", ImmutableMap.builder().put("type", "fs").put("option", ImmutableMap.of()).build())) .build())/*from ww w. j a v a 2s .com*/ .put("port", config.getS3Port()).put("current_driver", "fs-1").put("logtype", "winston") .put("logfile", config.getHome() + "/log.txt").put("auth", "s3").put("debug", true) .put("account_api", false).put("keyID", config.getAuthorizedAccessKey()) .put("secretID", config.getAuthorizedSecretKey()).build(); String configJson = new GsonBuilder().setPrettyPrinting().create().toJson(configJ); String fileName = config.getHome() + "/config.json"; return createOrOverwriteFile(fileName, Collections.singleton(configJson)); }
From source file:co.cask.cdap.internal.app.deploy.pipeline.EnableConcurrentRunsStage.java
@Override public void process(ApplicationWithPrograms input) throws Exception { Map<String, String> properties = ImmutableMap.of(ProgramOptionConstants.CONCURRENT_RUNS_ENABLED, "true"); preferencesStore.setProperties(input.getId().getNamespaceId(), input.getSpecification().getName(), properties);/*from ww w . j a v a2s .c o m*/ emit(input); }