Example usage for org.apache.commons.collections.map Flat3Map Flat3Map

List of usage examples for org.apache.commons.collections.map Flat3Map Flat3Map

Introduction

In this page you can find the example usage for org.apache.commons.collections.map Flat3Map Flat3Map.

Prototype

public Flat3Map() 

Source Link

Document

Constructor.

Usage

From source file:org.lockss.config.TdbAu.java

/**
 * Create a new instance of an au.//www.  ja v  a  2s  . com
 * 
 * @param name the name of the au
 * @param pluginId the id of the plugin.
 * @param pluginId the plugin ID of this AU
 */
protected TdbAu(String name, String pluginId) {
    if (name == null) {
        throw new IllegalArgumentException("au name cannot be null");
    }

    if (pluginId == null) {
        throw new IllegalArgumentException("au pluginId cannot be null");
    }

    this.name = name;
    this.pluginId = StringPool.PLUGIN_IDS.intern(pluginId);
    //     params = new HashMap<String,String>();
    params = new Flat3Map();
}

From source file:org.lockss.config.TdbAu.java

/**
 * Set AU properties by name.//  w w  w . j a va2 s  . co  m
 * 
 * @param name the property name
 * @param value the property value
 * @throws TdbException if cannot set property
 */
protected void setPropertyByName(String name, String value) throws TdbException {
    if (name == null) {
        throw new IllegalArgumentException("property name cannot be null");
    }
    if (name.equals("pluginId")) {
        throw new TdbException(
                "cannot reset pluginId property \"" + pluginId + "\" for au \"" + this.name + "\"");
    } else if (name.equals("name")) {
        throw new TdbException("cannot reset name property \"" + name + "\" for au \"" + this.name + "\"");
    } else {
        if (value == null) {
            throw new TdbException(
                    "value cannot be null for property \"" + name + "\" for au \"" + this.name + "\"");
        }
        if (props == null) {
            //         props = new HashMap<String,String>();
            props = new Flat3Map();
        }
        props.put(StringPool.TDBAU_PROPS.intern(name), StringPool.TDBAU_PROPS.internMapValue(name, value));
    }
}

From source file:org.lockss.config.TdbAu.java

/**
 * Set the value of an attribute./*from w w  w .  ja v a 2s.  c o m*/
 * 
 * @param name the attr name
 * @param value the non-null attr value
 * @throws TdbException if attr already set
 */
protected void setAttr(String name, String value) throws TdbException {
    if (name == null) {
        throw new IllegalArgumentException("attr name cannot be null for au \"" + this.name + "\"");
    }
    if (value == null) {
        throw new IllegalArgumentException(
                "value of attr \"" + name + "\" cannot be null for au \"" + this.name + "\"");
    }

    if (attrs == null) {
        //       attrs = new HashMap<String,String>();
        attrs = new Flat3Map();
    }

    if (attrs.containsKey(name)) {
        throw new TdbException("cannot replace value of au attr \"" + name + "\" for au \"" + this.name + "\"");
    }
    attrs.put(StringPool.TDBAU_ATTRS.intern(name), StringPool.TDBAU_ATTRS.internMapValue(name, value));
}