Java 类org.apache.commons.collections4.map.UnmodifiableMap 实例源码

项目:actors    文件:ThreadPoolShuttle.java   
ThreadPoolShuttle(
        String prefix,
        ExecutorService threadPool,
        Map<Class<?>, ThreadPoolProcessor> payloadTypes,
        ConcurrentHashMap<String, Shuttle> outShuttles) {
    Validate.notNull(prefix);
    Validate.notNull(threadPool);
    Validate.notNull(payloadTypes);
    Validate.notNull(outShuttles); // outShuttles is concurrent map -- entries added/removed on the fly, don't nullcheck keys or values
    Validate.noNullElements(payloadTypes.keySet());
    Validate.noNullElements(payloadTypes.values());
    this.prefix = prefix;
    this.threadPool = threadPool;
    this.payloadTypes = (UnmodifiableMap<Class<?>, ThreadPoolProcessor>) unmodifiableMap(new HashMap<>(payloadTypes));
    this.outShuttles = outShuttles;
}
项目:coroutines    文件:InstrumentationResult.java   
InstrumentationResult(
        byte[] instrumentedClass,
        Map<String, byte[]> extraFiles) {
    Validate.notNull(instrumentedClass);
    Validate.notNull(extraFiles);
    Validate.noNullElements(extraFiles.keySet());
    Validate.noNullElements(extraFiles.values());

    this.instrumentedClass = Arrays.copyOf(instrumentedClass, instrumentedClass.length);
    this.extraFiles = (UnmodifiableMap<String, byte[]>) UnmodifiableMap.unmodifiableMap(new HashMap<>(extraFiles));
}
项目:HCFCore    文件:UnmodifiableMultiValuedMap.java   
@Override
public Map<K, Collection<V>> asMap() {
    return UnmodifiableMap.unmodifiableMap(decorated().asMap());
}
项目:HCFCore    文件:UnmodifiableMultiValuedMap.java   
@Override
public Map<K, Collection<V>> asMap() {
    return UnmodifiableMap.unmodifiableMap(decorated().asMap());
}
项目:HCFCore    文件:MapUtils.java   
/**
 * Returns an unmodifiable map backed by the given map.
 * <p>
 * This method uses the implementation in the decorators subpackage.
 *
 * @param <K>  the key type
 * @param <V>  the value type
 * @param map  the map to make unmodifiable, must not be null
 * @return an unmodifiable map backed by the given map
 * @throws NullPointerException  if the map is null
 */
public static <K, V> Map<K, V> unmodifiableMap(final Map<? extends K, ? extends V> map) {
    return UnmodifiableMap.unmodifiableMap(map);
}
项目:HCFCore    文件:MapUtils.java   
/**
 * Returns an unmodifiable map backed by the given map.
 * <p>
 * This method uses the implementation in the decorators subpackage.
 *
 * @param <K>  the key type
 * @param <V>  the value type
 * @param map  the map to make unmodifiable, must not be null
 * @return an unmodifiable map backed by the given map
 * @throws NullPointerException  if the map is null
 */
public static <K, V> Map<K, V> unmodifiableMap(final Map<? extends K, ? extends V> map) {
    return UnmodifiableMap.unmodifiableMap(map);
}
项目:coroutines    文件:InstrumentationResult.java   
/**
 * Get extra files to include along with the instrumented class.
 * @return extra files to include along with the instrumented class
 */
public UnmodifiableMap<String, byte[]> getExtraFiles() {
    return extraFiles;
}