Example usage for org.apache.commons.collections.map UnmodifiableMap decorate

List of usage examples for org.apache.commons.collections.map UnmodifiableMap decorate

Introduction

In this page you can find the example usage for org.apache.commons.collections.map UnmodifiableMap decorate.

Prototype

public static Map decorate(Map map) 

Source Link

Document

Factory method to create an unmodifiable map.

Usage

From source file:com.bstek.dorado.console.system.log.file.FileReaderManager.java

@SuppressWarnings("unchecked")
public Map<String, FileReader> getReaders() {
    return UnmodifiableMap.decorate(readerMap);
}

From source file:com.bstek.dorado.common.service.ExposedServiceManager.java

@SuppressWarnings("unchecked")
public Map<String, ExposedServiceDefintion> getServices() {
    return UnmodifiableMap.decorate(serviceMap);
}

From source file:eagle.alert.siddhi.StreamMetadataManager.java

public Map<String, List<AlertStreamSchemaEntity>> getMetadataEntitiesForAllStreams() {
    ensureInitialized();
    return UnmodifiableMap.decorate(map);
}

From source file:com.bstek.dorado.common.event.ClientEventRegistry.java

/**
 * ?Class??/* w  ww.  j  av a 2 s  . c  o  m*/
 * 
 * @param type
 *            Class
 * @return ?Map?Map????
 */
@SuppressWarnings("unchecked")
public static Map<String, ClientEventRegisterInfo> getClientEventRegisterInfos(
        Class<? extends ClientEventSupported> type) {
    synchronized (type) {
        Map<String, ClientEventRegisterInfo> eventMap = typeMapCache.get(type);
        if (eventMap == null) {
            eventMap = new HashMap<String, ClientEventRegisterInfo>();
            collectClientEventRegisterInfos(eventMap, type);
            eventMap = (eventMap.isEmpty()) ? EMPTY_MAP : UnmodifiableMap.decorate(eventMap);
            typeMapCache.put(type, eventMap);
        }
        return eventMap;
    }
}

From source file:eagle.alert.siddhi.StreamMetadataManager.java

public Map<String, SortedMap<String, AlertStreamSchemaEntity>> getMetadataEntityMapForAllStreams() {
    ensureInitialized();
    return UnmodifiableMap.decorate(map2);
}

From source file:com.bstek.dorado.idesupport.model.Rule.java

@SuppressWarnings("unchecked")
public Map<String, Child> getChildren() {
    return UnmodifiableMap.decorate(children);
}

From source file:org.apache.metron.stellar.common.shell.DefaultStellarShellExecutor.java

@Override
public Map<String, VariableResult> getState() {
    return UnmodifiableMap.decorate(variables);
}

From source file:org.jahia.admin.AdministrationModulesRegistry.java

@SuppressWarnings("unchecked")
private void rebuildRegistry() {
    if (!(serverModules instanceof UnmodifiableList)) {
        Collections.sort(serverModules, MODULE_COMPARATOR);
        serverModules = UnmodifiableList.decorate(serverModules);
        serverModulesByUrlKey = new HashMap<String, AdministrationModule>(serverModules.size());
        for (AdministrationModule module : serverModules) {
            serverModulesByUrlKey.put(module.getUrlKey(), module);
        }//ww w  . j a v  a 2s  .  com
        serverModulesByUrlKey = UnmodifiableMap.decorate(serverModulesByUrlKey);
    }
    if (!(siteModules instanceof UnmodifiableList)) {
        siteModules = new LinkedList<AdministrationModule>(siteModules);
        Collections.sort(siteModules, MODULE_COMPARATOR);
        siteModules = UnmodifiableList.decorate(siteModules);
        siteModulesByUrlKey = new HashMap<String, AdministrationModule>(siteModules.size());
        for (AdministrationModule module : siteModules) {
            siteModulesByUrlKey.put(module.getUrlKey(), module);
        }
        siteModulesByUrlKey = UnmodifiableMap.decorate(siteModulesByUrlKey);
    }
}

From source file:org.jahia.services.content.JCRContentUtils.java

/**
 * Initializes an instance of this class.
 *
 * @param mimeTypes a map with mime type mappings
 * @param fileExtensionIcons mapping between file extensions and corresponding icons
 *///from   ww w . j a v a  2 s . co  m
@SuppressWarnings("unchecked")
public JCRContentUtils(Map<String, List<String>> mimeTypes, Map<String, String> fileExtensionIcons,
        Map<String, String> defaultUserFolderTypes) {
    instance = this;
    this.mimeTypes = UnmodifiableMap.decorate(mimeTypes);
    this.fileExtensionIcons = UnmodifiableMap.decorate(fileExtensionIcons);
    this.defaultUserFolderTypes = UnmodifiableMap.decorate(defaultUserFolderTypes);
}

From source file:org.jahia.taglibs.utility.constants.JahiaUseConstantsTag.java

private Map<?, ?> getConstants() throws JspTagException {
    Map<?, ?> constants = null;
    try {/*  ww  w.  j ava2s .c o m*/
        constants = ClassUtils.getClassConstants(getClassName());
    } catch (ClassNotFoundException e) {
        throw new JspTagException("Class not found: " + getClassName());
    } catch (IllegalArgumentException e) {
        throw new JspTagException("Illegal argument: " + getClassName());
    } catch (IllegalAccessException e) {
        throw new JspTagException("Illegal access: " + getClassName());
    }

    // make the map keys case-insensitive and the map unmodifiable
    return UnmodifiableMap.decorate(new CaseInsensitiveMap(constants));
}