Example usage for com.google.common.collect ImmutableMap copyOf

List of usage examples for com.google.common.collect ImmutableMap copyOf

Introduction

In this page you can find the example usage for com.google.common.collect ImmutableMap copyOf.

Prototype

public static <K, V> ImmutableMap<K, V> copyOf(Iterable<? extends Entry<? extends K, ? extends V>> entries) 

Source Link

Usage

From source file:jflowmap.views.EnumColorScheme.java

private EnumColorScheme(String name, Map<ColorCodes, Getter> colors) {
    this.name = name;
    for (ColorCodes code : ColorCodes.values()) {
        if (!colors.containsKey(code)) {
            throw new IllegalArgumentException("Color " + code + " is missing");
        }//ww w  .j  a  v  a2  s . com
    }
    this.colors = ImmutableMap.copyOf(colors);
}

From source file:org.blockartistry.mod.ThermalRecycling.data.RecipeData.java

public static void freeze() {
    recipes = ImmutableMap.copyOf(recipes);
}

From source file:co.cask.cdap.api.dataset.lib.PartitionFilter.java

private PartitionFilter(Map<String, Condition<? extends Comparable>> conditions) {
    this.conditions = ImmutableMap.copyOf(conditions);
}

From source file:co.cask.cdap.api.dataset.DatasetProperties.java

private DatasetProperties(Map<String, String> properties) {
    this.properties = ImmutableMap.copyOf(properties);
}

From source file:org.opendaylight.netide.openflowjava.protocol.impl.deserialization.NetIdeDeserializationFactory.java

/**
 * Constructor//from w  ww.  j ava 2  s.  c o m
 */
public NetIdeDeserializationFactory() {
    final Map<TypeToClassKey, Class<?>> temp = new HashMap<>();
    NetIdeTypeToClassMapInitializer.initializeTypeToClassMap(temp);
    messageClassMap = ImmutableMap.copyOf(temp);
}

From source file:com.proofpoint.discovery.store.StoreResource.java

@Inject
public StoreResource(Map<String, InMemoryStore> localStores, Map<String, StoreConfig> configs) {
    this.localStores = ImmutableMap.copyOf(localStores);
    this.tombstoneMaxAges = ImmutableMap.copyOf(Maps.transformValues(configs, StoreConfig::getTombstoneMaxAge));
}

From source file:io.atomix.protocols.gossip.map.AntiEntropyAdvertisement.java

/**
 * Creates a new anti entropy advertisement message.
 *
 * @param sender the sender's node ID/*  w  w  w. j  a v a 2s  .com*/
 * @param digest for map entries
 */
public AntiEntropyAdvertisement(MemberId sender, Map<String, MapValue.Digest> digest) {
    this.sender = checkNotNull(sender);
    this.digest = ImmutableMap.copyOf(checkNotNull(digest));
}

From source file:com.atlassian.jira.rest.client.api.domain.util.ErrorCollection.java

public ErrorCollection(@Nullable final Integer status, final Collection<String> errorMessages,
        final Map<String, String> errors) {
    this.status = status;
    this.errors = ImmutableMap.copyOf(errors);
    this.errorMessages = ImmutableList.copyOf(errorMessages);
}

From source file:com.splicemachine.orc.stream.StreamSources.java

public StreamSources(Map<StreamId, StreamSource<?>> streamSources) {
    this.streamSources = ImmutableMap.copyOf(requireNonNull(streamSources, "streamSources is null"));
}

From source file:org.apache.helix.api.config.SchedulerTaskConfig.java

public SchedulerTaskConfig(Map<String, Integer> transitionTimeoutMap, Map<PartitionId, Message> innerMsgMap) {
    _transitionTimeoutMap = ImmutableMap.copyOf(transitionTimeoutMap);
    _innerMessageMap = ImmutableMap.copyOf(innerMsgMap);
}