All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ajjpj.abase.collection.immutable.AMapWithDefaultValue Maven / Gradle / Ivy

Go to download

a-base is a library of basic (hence the name) classes, most notably immutable collection classes with copy-on-write operations

There is a newer version: 1.0-pre11
Show newest version
package com.ajjpj.abase.collection.immutable;

/**
 * @author arno
 */
class AMapWithDefaultValue extends AWrappedMap {
    private final V defaultValue;

    AMapWithDefaultValue(AMap inner, V defaultValue) {
        super(inner);
        this.defaultValue = defaultValue;
    }

    @Override AMap wrap(AMap inner) {
        return new AMapWithDefaultValue<>(inner, defaultValue);
    }

    @Override V defaultValue(K key) {
        return defaultValue;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy