|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.endeca.edf.adapter.AdapterConfig
public class AdapterConfig
Contains configuration information handed to the adapter class via the execute method. The configuration data herein is essentially a multimap of name-value pairs, where a given name name may have one or more values associated with it.
Adapter
Field Summary | |
---|---|
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> |
map
|
Constructor Summary | |
---|---|
AdapterConfig()
Constructs a new configuration container that is empty. |
Method Summary | |
---|---|
boolean |
containsName(java.lang.String name)
Tests to see if any values are associated with the given name. |
java.lang.String |
first(java.lang.String name)
Retrieves the first value associated with the given name (this corresponds to the first value stored under this name). |
double |
firstDoubleOrDefault(java.lang.String key,
double defaultVal)
Same as firstOrDefault(), but throws an AdapterException if the value cannot be converted into a double. |
int |
firstIntOrDefault(java.lang.String key,
int defaultVal)
Same as firstOrDefault(), but throws an AdapterException if the value cannot be converted into an integer. |
java.lang.String |
firstOrDefault(java.lang.String name,
java.lang.String defaultValue)
Same as first(), but returns defaultValue if there is no value associated with the given name. |
java.lang.String[] |
get(java.lang.String name)
Retrieves a string array of values associated with the given name. |
java.util.Set<java.lang.String> |
nameSet()
Provides a set of all names contained within this object. |
void |
put(java.lang.String name,
java.lang.String value)
Add a name-value pair to the configuration (a name can be associated with multiple values). |
void |
put(java.lang.String name,
java.lang.String[] values)
Add values associated with the given name to the configuration. |
java.lang.String |
requiredFirst(java.lang.String name)
Same as first(), but throws an AdapterException if there is no value associated with the given name. |
java.lang.String |
toString()
Provides a user-readable string representation of this configuration. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public java.util.Map<java.lang.String,java.util.Set<java.lang.String>> map
Constructor Detail |
---|
public AdapterConfig()
Method Detail |
---|
public void put(java.lang.String name, java.lang.String value)
name
- the name of the configuration data.value
- the value of the configuration data.public void put(java.lang.String name, java.lang.String[] values)
name
- the name of the configuration data.values
- a string array of configuration data.public java.lang.String[] get(java.lang.String name)
name
- the name of the values to retrieve.
public java.lang.String first(java.lang.String name)
name
- the name of the value to retrieve.
public java.lang.String requiredFirst(java.lang.String name) throws AdapterException
AdapterException
public java.lang.String firstOrDefault(java.lang.String name, java.lang.String defaultValue) throws AdapterException
AdapterException
public int firstIntOrDefault(java.lang.String key, int defaultVal) throws AdapterException
AdapterException
public double firstDoubleOrDefault(java.lang.String key, double defaultVal) throws AdapterException
AdapterException
public boolean containsName(java.lang.String name)
AdapterConfig.get(name) != null
name
- the name to check for value association.
public java.lang.String toString()
name1={value1,value2}
name2={value1}
...
toString
in class java.lang.Object
public java.util.Set<java.lang.String> nameSet()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |