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

org.tango.client.database.cache.AttributeCache Maven / Gradle / Ivy

There is a newer version: 10.0.0
Show 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.Map;

public final class AttributeCache {
    private final String name;
    private final Map propertiesCache = new CaseInsensitiveMap();

    AttributeCache(final String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void addProperty(final String propertyName, final String[] propertyValue) {
        propertiesCache.put(propertyName, propertyValue);
    }

    public Map getPropertiesCache() {
        return new CaseInsensitiveMap(propertiesCache);
    }

    public void addProperties(final Map properties) {
        propertiesCache.putAll(properties);
    }

    public void removeAll() {
        propertiesCache.clear();
    }

    /**
     * @return a string
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy