Example usage for java.util Collections unmodifiableMap

List of usage examples for java.util Collections unmodifiableMap

Introduction

In this page you can find the example usage for java.util Collections unmodifiableMap.

Prototype

public static <K, V> Map<K, V> unmodifiableMap(Map<? extends K, ? extends V> m) 

Source Link

Document

Returns an unmodifiable view of the specified map.

Usage

From source file:org.n52.io.response.ServiceOutput.java

@JsonAnyGetter
public Map<String, Object> getFeatures() {
    return features != null ? Collections.unmodifiableMap(features) : null;
}

From source file:io.kazuki.v0.store.schema.model.IndexDefinition.java

@JsonCreator
public IndexDefinition(@JsonProperty("name") String name, @JsonProperty("cols") List<IndexAttribute> cols,
        @JsonProperty("unique") @Nullable Boolean unique, @JsonProperty("renameOf") @Nullable String renameOf) {
    Preconditions.checkNotNull(name, "name");
    Preconditions.checkNotNull(cols, "cols");
    Preconditions.checkArgument(!cols.isEmpty(), "cols");

    this.name = name;
    this.unique = (unique != null && unique);

    List<String> newAttributeNames = new ArrayList<String>();
    Map<String, IndexAttribute> newIndexAttributeMap = new LinkedHashMap<String, IndexAttribute>();

    for (IndexAttribute attr : cols) {
        String attrName = attr.getName();

        if (newIndexAttributeMap.containsKey(attrName)) {
            throw new IllegalArgumentException("index definition contains duplicate attribute: " + attrName);
        }/*from  w ww. j av a 2s  . co  m*/

        newAttributeNames.add(attrName);
        newIndexAttributeMap.put(attrName, attr);
    }

    if (newIndexAttributeMap.containsKey("id")) {
        throw new IllegalArgumentException("index definition must not contain 'id' attribute");
    }

    this.indexColumns = Collections.unmodifiableList(cols);
    this.attributeNames = Collections.unmodifiableList(newAttributeNames);
    this.indexAttributeMap = Collections.unmodifiableMap(newIndexAttributeMap);
    this.renameOf = renameOf;
}

From source file:edu.wisc.my.stats.dao.support.ConsolidatingQueryInformationDao.java

/**
 * @see edu.wisc.my.stats.dao.QueryInformationDao#getQueryInformationByFactMap()
 *///w  w w.  ja  v a 2s.c o m
@SuppressWarnings("unchecked")
public Map<Fact, Set<QueryInformation>> getQueryInformationByFactMap() {
    final Set<Map<Fact, Set<QueryInformation>>> queryInformationByFactMaps = new HashSet<Map<Fact, Set<QueryInformation>>>();

    for (final QueryInformationDao queryInformationDao : this.readableQueryInformationDaos) {
        final Map<Fact, Set<QueryInformation>> queryInformationByFactMap = queryInformationDao
                .getQueryInformationByFactMap();
        queryInformationByFactMaps.add(queryInformationByFactMap);
    }

    final CompositeMap cm = new CompositeMap(
            queryInformationByFactMaps.toArray(new Map[queryInformationByFactMaps.size()]));
    return Collections.unmodifiableMap(cm); //will this work?
}

From source file:eu.freme.broker.tools.internationalization.BodySwappingServletRequest.java

@Override
public Map<String, String[]> getParameterMap() {
    TreeMap<String, String[]> map = new TreeMap<String, String[]>();
    map.putAll(super.getParameterMap());
    map.put("informat", new String[] { "turtle" });
    map.remove("input");

    if (changeResponse) {
        map.put("outformat", new String[] { "turtle" });
    }//  w  w w .j  a  va  2  s. c  om

    return Collections.unmodifiableMap(map);
}

From source file:edu.ksu.cis.indus.staticanalyses.callgraphs.CallInfo.java

/**
 * @see CallGraphInfo.ICallInfo#getCaller2CalleesMap()
 *//*from  w  ww.j av a2 s .  com*/
public Map<SootMethod, Collection<CallTriple>> getCaller2CalleesMap() {
    return Collections.unmodifiableMap(caller2callees);
}

From source file:com.alibaba.napoli.metamorphosis.client.extension.producer.ProducerDiamondManager.java

public Map<String, List<Partition>> getPartitions() {
    return Collections.unmodifiableMap(this.partitionsMap);
}

From source file:com.frank.search.solr.core.query.StatsOptions.java

/**
 * @return the selective facets to be requested.
 */// www .j av  a  2s.  com
public Map<Field, Collection<Field>> getSelectiveFacets() {
    return Collections.unmodifiableMap(state.selectiveFacets);
}

From source file:libepg.epg.section.sectionreconstructor.SectionReconstructorTest.java

private Map<Integer, List<TsPacketParcel>> getParcels() {
    List<TsPacket> packets = this.eits.getEitList();
    Map<Integer, List<TsPacketParcel>> parcels = new HashMap<>();

    //pid??????????
    for (TsPacketAligner alligner : this.als) {
        for (TsPacket p : packets) {
            alligner.add(p);//from  w  ww.  j a  v  a2 s.co m
        }
        parcels.put(alligner.getPid(), alligner.getPackets());
    }
    return Collections.unmodifiableMap(parcels);
}

From source file:io.wcm.caravan.io.http.response.Response.java

private Response(int status, String reason, Map<String, Collection<String>> headers, Body body) {
    checkState(status >= 200, "Invalid status code: %s", status);
    this.status = status;
    this.reason = checkNotNull(reason, "reason");
    LinkedHashMap<String, Collection<String>> copyOf = new LinkedHashMap<String, Collection<String>>();
    copyOf.putAll(checkNotNull(headers, "headers"));
    this.headers = Collections.unmodifiableMap(copyOf);
    this.body = body; //nullable
}