![JAR search and dependency download from the Maven repository](/logo.png)
com.maxifier.mxcache.provider.PropertyOverrides Maven / Gradle / Ivy
/*
* Copyright (c) 2008-2014 Maxifier Ltd. All Rights Reserved.
*/
package com.maxifier.mxcache.provider;
import gnu.trove.map.hash.THashMap;
import java.util.Map;
/**
* @author Alexander Kochurov ([email protected])
*/
class PropertyOverrides {
private final PropertyOverrides parent;
private final Map values;
PropertyOverrides(PropertyOverrides parent) {
this.parent = parent;
values = new THashMap();
}
@SuppressWarnings("unchecked")
public T get(StrategyProperty property) {
Object value = values.get(property);
if (value == null && parent != null) {
return parent.get(property);
}
return (T)value;
}
public PropertyOverrides override(StrategyProperty property, T value) {
values.put(property, value);
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy