|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jstatcom.engine.ConfigKeys
public abstract class ConfigKeys
This class contains an enumeration of constants that define different types of information needed for a certain engine to run, for example the location of the executable, the temporary directory, etc. This class needs to be subclassed to define the necessary constants for a certain engine.
It implements the typesave enum pattern (Joshua Bloch, "Effective
Java", Item 21) . If you compare ConfigKeys
, always
use the ==
operator.
Constructor Summary | |
---|---|
ConfigKeys(java.lang.String name)
Creates a new config key. |
Method Summary | |
---|---|
abstract java.lang.String |
defaultVal()
Gets the default value for this config key. |
boolean |
equals(java.lang.Object o)
Override prevention method to enforce a.equals(b) if and
only if a==b . |
static java.util.Map<java.lang.String,ConfigKeys> |
getAllKeys(java.lang.Class c)
Gets a map of all public keys defined in class c . |
int |
hashCode()
Override prevention method invokes super method. |
abstract java.lang.String |
isValid(java.lang.String value)
Gets whether value is valid for this . |
java.lang.String |
name()
Gets the name of this . |
java.lang.String |
toString()
Gets a string representation. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ConfigKeys(java.lang.String name)
name
- the identifier of the new key
java.lang.IllegalArgumentException
- if (name == null)
Method Detail |
---|
public abstract java.lang.String defaultVal()
""
if no reasonable
default existspublic final boolean equals(java.lang.Object o)
a.equals(b)
if and
only if a==b
.
equals
in class java.lang.Object
o
- object to compare with
true
if equal, false
otherwisepublic static java.util.Map<java.lang.String,ConfigKeys> getAllKeys(java.lang.Class c)
c
. All key
objects are stored with its name as the respective key.
java.lang.IllegalArgumentException
- if (c.getSuperclass() != ConfigKeys.class)
or
if (c == null)
public final int hashCode()
hashCode
in class java.lang.Object
public abstract java.lang.String isValid(java.lang.String value)
value
is valid for this
.
value
- a string value for this key
null
if valid, an error string if not validpublic final java.lang.String name()
this
.
public final java.lang.String toString()
toString
in class java.lang.Object
this
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |