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:nu.yona.server.goals.service.ActivityCategoryDto.java

@JsonIgnore
public Map<Locale, String> getLocalizableNameByLocale() {
    return Collections.unmodifiableMap(localizableName);
}

From source file:com.serendio.lingo3g.ProcessingResult.java

/**
 * Creates a {@link ProcessingResult} with the provided <code>attributes</code>.
 * Assigns unique document identifiers if documents are present in the
 * <code>attributes</code> map (under the key {@link AttributeNames#DOCUMENTS}).
 *//*from   ww w .ja  v a 2 s . co  m*/
@SuppressWarnings("unchecked")
ProcessingResult(Map<String, Object> attributes) {
    this.attributes = attributes;

    // Replace a modifiable collection of documents with an unmodifiable one
    final List<Document> documents = (List<Document>) attributes.get(AttributeNames.DOCUMENTS);
    //        if (documents != null)
    //        {
    //            Document.assignDocumentIds(documents);
    //            attributes.put(AttributeNames.DOCUMENTS,
    //                Collections.unmodifiableList(documents));
    //        }

    // Replace a modifiable collection of clusters with an unmodifiable one
    final List<Cluster> clusters = (List<Cluster>) attributes.get(AttributeNames.CLUSTERS);
    if (clusters != null) {
        Cluster.assignClusterIds(clusters);
        attributes.put(AttributeNames.CLUSTERS, Collections.unmodifiableList(clusters));
    }

    // Store a reference to attributes as an unmodifiable map
    this.attributesView = Collections.unmodifiableMap(attributes);

}

From source file:com.ericsson.deviceaccess.spi.impl.genericdevice.GDServiceImpl.java

/**
 * {@inheritDoc}/*from  w  w  w  . j  a v a2s  .  c om*/
 */
@Override
public Map<String, GDAction> getActions() {
    checkPermission(getClass(), Type.GET);
    return Collections.unmodifiableMap(action);
}

From source file:jails.http.HttpHeaders.java

/**
 * Private constructor that can create read-only {@code HttpHeader} instances.
 *///from   w  w w  .  ja  v a2s  .  co m
private HttpHeaders(Map<String, List<String>> headers, boolean readOnly) {
    Assert.notNull(headers, "'headers' must not be null");
    if (readOnly) {
        Map<String, List<String>> map = new LinkedCaseInsensitiveMap<List<String>>(headers.size(),
                Locale.ENGLISH);
        for (Entry<String, List<String>> entry : headers.entrySet()) {
            List<String> values = Collections.unmodifiableList(entry.getValue());
            map.put(entry.getKey(), values);
        }
        this.headers = Collections.unmodifiableMap(map);
    } else {
        this.headers = headers;
    }
}

From source file:org.paxml.table.jdbc.JdbcTable.java

@Override
public Map<String, IColumn> getColumnsMap() {
    return Collections.unmodifiableMap(columns);
}

From source file:org.ocsoft.olivia.logger.OliviaLog.java

/**
 * ???????????.
 * @return ??????
 */
@Nonnull
public Map<String, String> getData() {
    return Collections.unmodifiableMap(logData);
}

From source file:dk.netarkivet.common.utils.cdx.CDXReader.java

/** Get a table of all filters.
 *  @return a Hashtable with all the filters.
 *///from  ww w  .ja va  2 s . c o  m
public Map<String, CDXRecordFilter> getFilters() {
    return Collections.unmodifiableMap(cdxrecordfilters);
}

From source file:com.qpark.eip.core.spring.AbstractPlaceholderConfigurer.java

/**
 * @return All loaded properties//from   w  w w .j ava  2 s .  c  o m
 */
public Map<String, String> getProperties() {
    return Collections.unmodifiableMap(this.properties);
}

From source file:net.centro.rtb.monitoringcenter.metrics.system.jvm.BufferPoolMetricSet.java

@Override
public Map<String, Metric> getMetrics() {
    return Collections.unmodifiableMap(metricsByNames);
}

From source file:fr.ritaly.dungeonmaster.ai.CreatureManager.java

/**
 * Returns the creatures occupying this position as a map.
 *
 * @return a map of creatures per sector. Never returns null.
 */// w w w.  ja va 2  s .  c  o m
public final Map<Sector, Creature> getCreatureMap() {
    if (creatures == null) {
        return Collections.emptyMap();
    }

    // Defensive recopy
    return Collections.unmodifiableMap(creatures);
}