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.eclipse.che.plugin.jdb.server.util.JavaDebuggerUtils.java
/** Connects to process and starts debug. */ public static JavaDebugger startJavaDebugger(Breakpoint breakpoint, BlockingQueue<DebuggerEvent> debuggerEvents) throws Exception { Map<String, String> connectionProperties = ImmutableMap.of("host", "localhost", "port", getProperty("debug.port")); JavaDebuggerFactory factory = new JavaDebuggerFactory(); JavaDebugger debugger = (JavaDebugger) factory.create(connectionProperties, debuggerEvents::add); debugger.start(new StartActionImpl(singletonList(breakpoint))); return debugger; }
From source file:com.zz.langchecker.LangChecker.java
public static LangChecker create() { return new LangChecker( ImmutableMap.of(Lang.EN, readVocabulary("nonexistent2gram-en.txt"), Lang.RU, readVocabulary("nonexistent2gram-ru.txt")), ImmutableMap.of(Lang.EN, readVocabulary("nonexistent3gram-en.txt"), Lang.RU, readVocabulary("nonexistent3gram-ru.txt")), ImmutableMap.of(Lang.EN, readVocabulary("nonexistentFirst4gram-en.txt"), Lang.RU, readVocabulary("nonexistentFirst4gram-ru.txt")), ImmutableMap.of(Lang.EN, readVocabulary("nonexistent4gram-en.txt"), Lang.RU, readVocabulary("nonexistent4gram-ru.txt"))); }
From source file:org.rf.ide.core.execution.server.response.InitializeAgent.java
@Override public String toMessage() throws ResponseException { try {//w w w. j av a 2s . c o m final Map<String, ? extends Object> arguments = ImmutableMap.of("mode", mode.name(), "wait_for_start_allowance", agentShouldWaitForSignal); final Map<String, Object> value = ImmutableMap.of("operating_mode", arguments); return new ObjectMapper().writeValueAsString(value); } catch (final IOException e) { throw new ResponseException("Unable to serialize initialize agent response arguments to json", e); } }
From source file:forms.meta.MetaMap.java
/** Returns a MetaMap containing the given mappings. */ public static <T, U> MetaMap of(MetaField<T> tVar, T tVal, MetaField<U> uVar, U uVal) { return new MetaMap(ImmutableMap.of(tVar, tVal, uVar, uVal)); }
From source file:org.apache.pulsar.tests.PulsarClusterUtils.java
public static String zookeeperConnectString(DockerClient docker, String cluster) { return DockerUtils.cubeIdsWithLabels(docker, ImmutableMap.of("service", "zookeeper", "cluster", cluster)) .stream().map((id) -> DockerUtils.getContainerIP(docker, id)).collect(Collectors.joining(":")); }
From source file:org.openqa.selenium.devtools.Target.java
public static Command<SessionId> attachToTarget(TargetId targetId) { Objects.requireNonNull(targetId, "Target ID must be set."); return new Command<>("Target.attachToTarget", ImmutableMap.of("targetId", targetId, "flatten", true), ConverterFunctions.map("sessionId", SessionId.class)); }
From source file:org.apache.druid.indexing.common.TaskRealtimeMetricsMonitorBuilder.java
public static TaskRealtimeMetricsMonitor build(Task task, FireDepartment fireDepartment, RowIngestionMeters meters) {/* w w w . j ava 2 s . c o m*/ return new TaskRealtimeMetricsMonitor(fireDepartment, meters, ImmutableMap.of(DruidMetrics.TASK_ID, new String[] { task.getId() }, DruidMetrics.TASK_TYPE, new String[] { task.getType() })); }
From source file:com.google.devtools.moe.client.database.RepositoryEquivalence.java
/** * Creates a {@link RepositoryEquivalence} from two revisions, which can be supplied in any order. *//*w w w . j a v a2s . c o m*/ public static RepositoryEquivalence create(Revision rev1, Revision rev2) { Preconditions.checkArgument(!rev1.equals(rev2), "Identical revisions are already equivalent."); return new AutoValue_RepositoryEquivalence( ImmutableMap.of(rev1.repositoryName(), rev1, rev2.repositoryName(), rev2)); }
From source file:co.cask.cdap.template.etl.batch.source.S3BatchSource.java
private static String createFileSystemProperties(String accessID, String accessKey) { return new Gson() .toJson(ImmutableMap.of("fs.s3n.awsAccessKeyId", accessID, "fs.s3n.awsSecretAccessKey", accessKey)); }
From source file:org.n52.svalbard.read.TimeReader.java
public TimeReader() { super(ImmutableMap.of(GmlConstants.QN_TIME_PERIOD_32, new TimePeriodReader(), GmlConstants.QN_TIME_INSTANT_32, new TimeInstantReader())); }