com.flexive.shared.configuration.parameters
Class BooleanParameter

java.lang.Object
  extended by com.flexive.shared.configuration.parameters.ParameterImpl<java.lang.Boolean>
      extended by com.flexive.shared.configuration.parameters.BooleanParameter
All Implemented Interfaces:
Parameter<java.lang.Boolean>, java.io.Serializable

 class BooleanParameter
extends ParameterImpl<java.lang.Boolean>

Boolean parameters for flexive.

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

Constructor Summary
BooleanParameter()
           
BooleanParameter(ParameterData<java.lang.Boolean> parameter, boolean registerParameter)
          Creates a new boolean parameter definition.
 
Method Summary
 Parameter<java.lang.Boolean> copy()
          Return a copy of this parameter instance.
 java.lang.Boolean getValue(java.lang.Object dbValue)
          Convert the given database value (in string representation) to an object of type T.
 boolean isValid(java.lang.Boolean value)
          Returns true if the given value is a valid configuration value (e.g.
 
Methods inherited from class com.flexive.shared.configuration.parameters.ParameterImpl
freeze, getData, getDatabaseValue, getDefaultValue, getKey, getPath, getScope, isCached, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BooleanParameter

public BooleanParameter()

BooleanParameter

public BooleanParameter(ParameterData<java.lang.Boolean> parameter,
                        boolean registerParameter)
Creates a new boolean parameter definition.

Parameters:
parameter - parameter data
registerParameter - if the parameter should be registered in the static parameter table (don't do this for non-static parameter declarations)
Method Detail

copy

public Parameter<java.lang.Boolean> copy()
Return a copy of this parameter instance. If this instance was frozen, the new object will be "unfrozen". The ParameterData instance will not be cloned, however you can replace it with a new instance, e.g. to update the parameter key.

Returns:
a copy of this parameter instance

getValue

public java.lang.Boolean getValue(java.lang.Object dbValue)
Convert the given database value (in string representation) to an object of type T.

Parameters:
dbValue - the value to be converted
Returns:
dbValue as type T.

isValid

public boolean isValid(java.lang.Boolean value)
Returns true if the given value is a valid configuration value (e.g. primitive parameters may not be null).

Specified by:
isValid in interface Parameter<java.lang.Boolean>
Overrides:
isValid in class ParameterImpl<java.lang.Boolean>
Parameters:
value - the value to be checked
Returns:
true if the given value is a valid configuration value