List of usage examples for com.google.common.collect ImmutableMap of
public static <K, V> ImmutableMap<K, V> of(K k1, V v1, K k2, V v2)
From source file:org.usc.wechat.mp.sdk.util.platform.UserUtil.java
public static UserInfoJsonRtn getUserInfo(License license, String openId, Locale local) { if (StringUtils.isEmpty(openId)) { return JsonRtnUtil.buildFailureJsonRtn(UserInfoJsonRtn.class, "missing openId"); }/* ww w . jav a2s. c om*/ String lang = local != null ? local.toString() : StringUtils.EMPTY; Map<String, String> paramMap = ImmutableMap.of("openid", openId, "lang", lang); return HttpUtil.getRequest(WechatRequest.GET_USER_INFO, license, paramMap, UserInfoJsonRtn.class); }
From source file:org.eclipse.che.plugin.gdb.server.util.GdbDebuggerUtils.java
public static GdbDebugger connectToGdb(BlockingQueue<DebuggerEvent> debuggerEvents) throws Exception { Map<String, String> connectionProperties = ImmutableMap.of("host", "localhost", "port", getProperty("debug.port")); GdbDebuggerFactory factory = new GdbDebuggerFactory(); GdbDebugger debugger = (GdbDebugger) factory.create(connectionProperties, debuggerEvents::add); debugger.start(new StartActionImpl(emptyList())); return debugger; }
From source file:com.vecna.dbDiff.business.catalogSchema.impl.DefaultCatalogSchemaResolverFactory.java
/** * Creates the default catalog/schema resolver * @return default catalog/schema resolver *//*from w w w . j a v a 2 s .c o m*/ public static CatalogSchemaResolver getCatalogSchemaResolver() { return new DelegatingByDriverCatalogSchemaResolverImpl(ImmutableMap.of("org.postgresql.Driver", new SimpleCatalogSchemaResolver(CatalogSchema.defaultCatalogSchema()), "net.sourceforge.jtds.jdbc.Driver", new SQLServerCatalogSchemaResolver())); }
From source file:org.jclouds.scriptbuilder.statements.ssh.SshStatements.java
/** * lock sshd down so root cannot login, and password auth is disabled, */// w ww. j a v a 2 s . c o m public static Statement lockSshd() { return sshdConfig(ImmutableMap.of("PasswordAuthentication", "no", "PermitRootLogin", "no")); }
From source file:com.google.cloud.spanner.TraceUtil.java
static Map<String, AttributeValue> getTransactionAnnotations(Transaction t) { return ImmutableMap.of("Id", AttributeValue.stringAttributeValue(t.getId().toStringUtf8()), "Timestamp", AttributeValue.stringAttributeValue(Timestamp.fromProto(t.getReadTimestamp()).toString())); }
From source file:org.sakaiproject.nakamura.lite.mongo.MongoSetup.java
public synchronized static MongoClientPool createClientPool(Configuration configuration) { try {//from w w w . jav a 2 s. c om MongoClientPool connectionPool = new MongoClientPool(); connectionPool.bindConfiguration(configuration); connectionPool.activate(ImmutableMap.of(MongoClientPool.PROP_MONGO_URI, (Object) "mongodb://127.0.0.1", MongoClientPool.PROP_MONGO_DB, (Object) "smc_unittests")); return connectionPool; } catch (MongoException e) { throw new RuntimeException(e.getMessage(), e); } catch (UnknownHostException e) { throw new RuntimeException(e.getMessage(), e); } }
From source file:com.github.blindpirate.gogradle.core.dependency.lock.GogradleLockModel.java
public static GogradleLockModel of(List<Map<String, Object>> buildNotations, List<Map<String, Object>> testNotations) { GogradleLockModel ret = new GogradleLockModel(); ret.dependencies = ImmutableMap.of(BUILD, buildNotations, TEST, testNotations); return ret;// w w w. ja v a 2 s .co m }
From source file:nu.yona.server.batch.quartz.jobs.PinResetConfirmationCodeSenderQuartzJob.java
public static Map<String, Object> buildParameterMap(UUID userId, String localeString) { return ImmutableMap.of(USER_ID_KEY, userId.toString(), LOCALE_STRING_KEY, localeString); }
From source file:org.apache.druid.indexing.common.TaskRealtimeMetricsMonitorBuilder.java
public static RealtimeMetricsMonitor build(Task task, FireDepartment fireDepartment) { return new RealtimeMetricsMonitor(ImmutableList.of(fireDepartment), ImmutableMap.of(DruidMetrics.TASK_ID, new String[] { task.getId() }, DruidMetrics.TASK_TYPE, new String[] { task.getType() })); }
From source file:co.cask.cdap.etl.mock.spark.Window.java
public static ETLPlugin getPlugin(long width, long slideInterval) throws IOException { return new ETLPlugin("Window", Windower.PLUGIN_TYPE, ImmutableMap.of("width", String.valueOf(width), "slideInterval", String.valueOf(slideInterval)), null);// w ww. j a v a 2 s . c om }