List of usage examples for com.google.common.collect Multimaps unmodifiableMultimap
@Deprecated public static <K, V> Multimap<K, V> unmodifiableMultimap(ImmutableMultimap<K, V> delegate)
From source file:org.apache.beam.runners.core.InMemoryMultimapSideInputView.java
/** * Creates a {@link MultimapView} from the provided values. The provided {@link Coder} is used to * guarantee structural equality for keys instead of assuming Java object equality. */// w w w . ja v a2 s .c o m public static <K, V> MultimapView<K, V> fromIterable(Coder<K> keyCoder, Iterable<KV<K, V>> values) { // We specifically use an array list multimap to allow for: // * null keys // * null values // * duplicate values Multimap<Object, Object> multimap = ArrayListMultimap.create(); for (KV<K, V> value : values) { multimap.put(keyCoder.structuralValue(value.getKey()), value.getValue()); } return new InMemoryMultimapSideInputView(keyCoder, Multimaps.unmodifiableMultimap(multimap)); }
From source file:ch.raffael.util.common.collections.UMultimap.java
public UMultimap(Multimap<K, V> delegate) { this.delegate = delegate; this.unmodifiable = Multimaps.unmodifiableMultimap(delegate); }
From source file:org.apache.aurora.scheduler.async.preemptor.CachedClusterState.java
@Override public Multimap<String, PreemptionVictim> getSlavesToActiveTasks() { return Multimaps.unmodifiableMultimap(victims); }
From source file:org.inferred.freebuilder.processor.util.testing.FakeMessager.java
public Multimap<String, String> getMessagesByElement() { return Multimaps.unmodifiableMultimap(messagesByElement); }
From source file:org.apache.brooklyn.util.http.executor.HttpRequestImpl.java
protected HttpRequestImpl(HttpRequest.Builder builder) { this.uri = checkNotNull(builder.uri, "uri"); this.method = checkNotNull(builder.method, "method"); this.body = builder.body; this.headers = Multimaps .unmodifiableMultimap(ArrayListMultimap.create(checkNotNull(builder.headers, "headers"))); this.credentials = builder.credentials; this.config = builder.config; }
From source file:co.cask.cdap.common.zookeeper.coordination.DefaultResourceAssigner.java
@Override public Multimap<T, PartitionReplica> get() { return Multimaps.unmodifiableMultimap(assignments); }
From source file:org.apache.cassandra.utils.BiMultiValMap.java
public Multimap<V, K> inverse() { return Multimaps.unmodifiableMultimap(reverseMap); }
From source file:org.cloudsmith.geppetto.validation.runner.ValidationAllContainersState.java
/** * Returns the map of restricted container handles, a get(String handle) * returns the set of visible container handles for the given handle. The * handle should be a File path to a module directory, a path to the root * (non modular content) of a repository, or the special string "_pptp". * /* w ww. j a v a 2s . c o m*/ * @return */ public Multimap<String, String> getRestricted() { return Multimaps.unmodifiableMultimap(restricted); }
From source file:org.apache.brooklyn.util.http.executor.HttpRequestImpl.java
public HttpRequestImpl(HttpRequestImpl httpRequest) { this.uri = checkNotNull(httpRequest.uri, "uri"); this.method = checkNotNull(httpRequest.method, "method"); this.body = httpRequest.body; this.headers = Multimaps .unmodifiableMultimap(ArrayListMultimap.create(checkNotNull(httpRequest.headers, "headers"))); this.credentials = httpRequest.credentials; this.config = httpRequest.config; }
From source file:com.google.jenkins.plugins.metadata.MetadataContainer.java
/** * @return the metadata contained. */ public Multimap<String, MetadataValue> getMetadata() { return Multimaps.unmodifiableMultimap(metadata); }