com.flexive.shared.configuration.parameters
Class IntegerParameter

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

 class IntegerParameter
extends ParameterImpl<java.lang.Integer>

Integer parameters for flexive.

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

Constructor Summary
IntegerParameter()
           
IntegerParameter(ParameterData<java.lang.Integer> parameter, boolean registerParameter)
          Creates a new integer parameter definition.
 
Method Summary
 Parameter<java.lang.Integer> copy()
          Return a copy of this parameter instance.
 java.lang.Integer getValue(java.lang.Object dbValue)
          Convert the given database value (in string representation) to an object of type T.
 boolean isValid(java.lang.Integer 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, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IntegerParameter

public IntegerParameter()

IntegerParameter

public IntegerParameter(ParameterData<java.lang.Integer> parameter,
                        boolean registerParameter)
Creates a new integer 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.Integer> 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.Integer 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.Integer 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.Integer>
Overrides:
isValid in class ParameterImpl<java.lang.Integer>
Parameters:
value - the value to be checked
Returns:
true if the given value is a valid configuration value