
org.tango.client.database.cache.ClassCache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of JTangoCommons Show documentation
Show all versions of JTangoCommons Show documentation
Common classes for tango java API
The newest version!
package org.tango.client.database.cache;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.tango.utils.CaseInsensitiveMap;
import java.util.HashMap;
import java.util.Map;
public final class ClassCache {
private final Map propertiesCache = new CaseInsensitiveMap();
private final String name;
private final Map deviceCaches = new CaseInsensitiveMap();
ClassCache(final String name) {
this.name = name;
}
public void addProperty(final String propertyName, final String[] propertyValue) {
propertiesCache.put(propertyName, propertyValue);
}
public void addDeviceCache(final DeviceCache cache) {
deviceCaches.put(cache.getName(), cache);
}
public Map getPropertiesCache() {
return new HashMap(propertiesCache);
}
public DeviceCache getDeviceCache(final String deviceName) {
return deviceCaches.get(deviceName);
}
public void addProperties(final Map properties) {
propertiesCache.putAll(properties);
}
public String getName() {
return name;
}
/**
* @return a string
*/
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy