List of usage examples for com.google.common.collect ImmutableMap copyOf
public static <K, V> ImmutableMap<K, V> copyOf(Iterable<? extends Entry<? extends K, ? extends V>> entries)
From source file:org.apache.beam.runners.samza.translation.SamzaPipelineTranslator.java
private static Map<String, TransformTranslator<?>> loadTranslators() { Map<String, TransformTranslator<?>> translators = new HashMap<>(); for (SamzaTranslatorRegistrar registrar : ServiceLoader.load(SamzaTranslatorRegistrar.class)) { translators.putAll(registrar.getTransformTranslators()); }//from w w w . ja va2 s . c o m return ImmutableMap.copyOf(translators); }
From source file:org.hawkular.client.core.ClientInfo.java
public ClientInfo(URI endpointUri, Optional<String> username, Optional<String> password, Map<String, Object> headers) { this.endpointUri = checkNotNull(endpointUri); this.username = checkNotNull(username); this.password = checkNotNull(password); this.headers = ImmutableMap.copyOf(checkNotNull(headers)); }
From source file:com.netflix.metacat.s3.connector.S3Plugin.java
@Override public synchronized void setOptionalConfig(final Map<String, String> optionalConfig) { this.optionalConfig = ImmutableMap .copyOf(Preconditions.checkNotNull(optionalConfig, "optionalConfig is null")); }
From source file:co.cask.cdap.common.namespace.SimpleNamespaceQueryAdmin.java
public SimpleNamespaceQueryAdmin(Map<String, NamespaceMeta> customNSMap) { this.customNSMap = ImmutableMap.copyOf(customNSMap); }
From source file:com.facebook.buck.jvm.java.Jsr199TracingBridge.java
@Override public void end(Map<String, String> args) { eventSink.reportCompilerPluginFinished(buildTarget, ImmutableMap.copyOf(args)); }
From source file:co.jirm.core.sql.MutableParameterized.java
@Override public ImmutableMap<String, Object> getNameParameters() { return ImmutableMap.copyOf(nameParameters); }
From source file:flipkart.mongodb.replicator.example.CheckPointExampleHandler.java
@Override public ImmutableMap<String, BsonTimestamp> getAllCheckPoints() { return ImmutableMap.copyOf(checkpoint); }
From source file:org.jclouds.b2.domain.B2Object.java
@SerializedNames({ "fileId", "fileName", "accountId", "bucketId", "contentLength", "contentSha1", "contentType", "fileInfo", "action", "uploadTimestamp", "contentRange", "payload" }) public static B2Object create(String fileId, String fileName, @Nullable String accountId, @Nullable String bucketId, @Nullable Long contentLength, @Nullable String contentSha1, @Nullable String contentType, @Nullable Map<String, String> fileInfo, @Nullable Action action, @Nullable Long uploadTimestamp, @Nullable String contentRange, @Nullable Payload payload) { if (fileInfo != null) { fileInfo = ImmutableMap.copyOf(fileInfo); }/*from w w w. j av a 2 s . c o m*/ Date date = uploadTimestamp == null ? null : new Date(uploadTimestamp); return new AutoValue_B2Object(fileId, fileName, contentSha1, fileInfo, payload, date, action, accountId, bucketId, contentLength, contentType, contentRange); }
From source file:com.google.gerrit.server.notedb.RevisionNoteMap.java
static RevisionNoteMap<RobotCommentsRevisionNote> parseRobotComments(ChangeNoteUtil noteUtil, ObjectReader reader, NoteMap noteMap) throws ConfigInvalidException, IOException { Map<RevId, RobotCommentsRevisionNote> result = new HashMap<>(); for (Note note : noteMap) { RobotCommentsRevisionNote rn = new RobotCommentsRevisionNote(noteUtil, reader, note.getData()); rn.parse();/*from w w w .j a va 2 s . c o m*/ result.put(new RevId(note.name()), rn); } return new RevisionNoteMap<>(noteMap, ImmutableMap.copyOf(result)); }
From source file:com.google.gerrit.server.git.ChangeSet.java
private static ImmutableMap<Change.Id, ChangeData> index(Iterable<ChangeData> changes, Collection<Change.Id> exclude) { Map<Change.Id, ChangeData> ret = new LinkedHashMap<>(); for (ChangeData cd : changes) { Change.Id id = cd.getId();/*from w w w .java2s. co m*/ if (!ret.containsKey(id) && !exclude.contains(id)) { ret.put(id, cd); } } return ImmutableMap.copyOf(ret); }