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

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

There is a newer version: 1.0-pre19
Show newest version
package com.ajjpj.afoundation.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