com.flexive.shared.configuration
Class ParameterDataBean<T>

java.lang.Object
  extended by com.flexive.shared.configuration.ParameterDataBean<T>
Type Parameters:
T - parameter value type
All Implemented Interfaces:
ParameterData<T>, java.io.Serializable
Direct Known Subclasses:
ParameterDataEditBean

public class ParameterDataBean<T>
extends java.lang.Object
implements ParameterData<T>

Basic implementation of ParameterData. Container for the path, the key and the default value of a parameter.

Author:
Daniel Lichtenberger (daniel.lichtenberger@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
See Also:
Serialized Form

Field Summary
protected  boolean cached
           
protected  T defaultValue
           
protected  java.lang.String key
           
protected  ParameterPath path
           
 
Constructor Summary
ParameterDataBean(ParameterPath path, boolean cached, T defaultValue)
          Constructor for aggregate parameters (with generated keys).
ParameterDataBean(ParameterPath path, java.lang.String key, boolean cached, T defaultValue)
          Constructor.
ParameterDataBean(ParameterPath path, java.lang.String key, T defaultValue)
          Constructor.
ParameterDataBean(ParameterPath path, T defaultValue)
          Constructor for aggregate parameters (with generated keys).
 
Method Summary
 boolean equals(java.lang.Object o)
           
 T getDefaultValue()
          Returns the default value of the parameter.
 java.lang.String getKey()
          Returns the key associated with the parameter.
 ParameterPath getPath()
          Returns the path object associated with the parameter.
 int hashCode()
           
 boolean isCached()
          Should this parameter be cached once it has been retrieved? By default all parameters are cached, but you can disable this for individual parameters that are seldom used or very large.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

path

protected ParameterPath path

key

protected java.lang.String key

defaultValue

protected T defaultValue

cached

protected boolean cached
Constructor Detail

ParameterDataBean

public ParameterDataBean(ParameterPath path,
                         java.lang.String key,
                         T defaultValue)
Constructor.

Parameters:
path - path for the parameter
key - key for the parameter (unless for aggregate parameters)
defaultValue - default value

ParameterDataBean

public ParameterDataBean(ParameterPath path,
                         T defaultValue)
Constructor for aggregate parameters (with generated keys).

Parameters:
path - path to be used for the parameters
defaultValue - the default value

ParameterDataBean

public ParameterDataBean(ParameterPath path,
                         java.lang.String key,
                         boolean cached,
                         T defaultValue)
Constructor.

Parameters:
path - path for the parameter
key - key for the parameter (unless for aggregate parameters)
cached - true if this parameter should be cached
defaultValue - default value
Since:
3.1.4

ParameterDataBean

public ParameterDataBean(ParameterPath path,
                         boolean cached,
                         T defaultValue)
Constructor for aggregate parameters (with generated keys).

Parameters:
path - path to be used for the parameters
cached - true if this parameter should be cached
defaultValue - the default value
Since:
3.1.4
Method Detail

getPath

public ParameterPath getPath()
Returns the path object associated with the parameter.

Specified by:
getPath in interface ParameterData<T>
Returns:
the path object associated with the parameter.

getKey

public java.lang.String getKey()
Returns the key associated with the parameter.

Specified by:
getKey in interface ParameterData<T>
Returns:
the key associated with the parameter.

getDefaultValue

public T getDefaultValue()
Returns the default value of the parameter.

Specified by:
getDefaultValue in interface ParameterData<T>
Returns:
the default value of the parameter.

isCached

public boolean isCached()
Description copied from interface: ParameterData
Should this parameter be cached once it has been retrieved? By default all parameters are cached, but you can disable this for individual parameters that are seldom used or very large.

Specified by:
isCached in interface ParameterData<T>
Returns:
true if this parameter should be cached. If false, each lookup is performed directly on the database.

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object