Package net.sf.basedb.core
Class LongParameterType
This class represent a parameter type that is a long.
This type defines a
lower limit
and an upper limit
for the range of
allowed values.- Version:
- 2.0
- Author:
- Nicklas
- Last modified
- $Date: 2012-09-14 09:28:35 +0200 (fr, 14 sep 2012) $
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreate a new long parameter type, without any limits and allowing null values.LongParameterType
(Long lowerLimit, Long upperLimit, Long defaultValue, boolean notNull) Create a new long parameter type.LongParameterType
(Long lowerLimit, Long upperLimit, Long defaultValue, boolean notNull, int multiplicity, int width, int height, List<Long> items) -
Method Summary
Modifier and TypeMethodDescriptionGet the lowest valid value of the parameter.Get the highest valid value of the parameter.(package private) LongParameterValueData
Create a newLongParameterValueData
object.toString()
(package private) void
validateValue
(String name, Long value) Checks if the value is within the range given by the upper and lower limits if those are given.Methods inherited from class net.sf.basedb.core.ParameterType
getDefaultValue, getEnumeration, getHeight, getItems, getMultiplicity, getNotNull, getParameterClass, getValueType, getWidth, isEnumeration, isMasked, validate, validate
-
Field Details
-
lowerLimit
The lower limit of the parameter. -
upperLimit
The upper limit of the parameter.
-
-
Constructor Details
-
LongParameterType
public LongParameterType()Create a new long parameter type, without any limits and allowing null values. -
LongParameterType
Create a new long parameter type.- Parameters:
lowerLimit
- The lowest allowed value, or null to have no limitupperLimit
- The highest allowed value, or null to have no limitdefaultValue
- Default value for the parameter.notNull
- FALSE if nulls values are allowed, TRUE otherwise
-
LongParameterType
-
-
Method Details
-
toString
-
validateValue
Checks if the value is within the range given by the upper and lower limits if those are given.- Specified by:
validateValue
in classParameterType<Long>
- Parameters:
value
- The value to testname
- The name of the parameter, use the name if there is need to throw an exception- Throws:
InvalidDataException
- If the value is outside the range of allowed values
-
newParameterValueData
LongParameterValueData newParameterValueData()Create a newLongParameterValueData
object.- Specified by:
newParameterValueData
in classParameterType<Long>
-
getLowerLimit
Get the lowest valid value of the parameter.- Returns:
- Lowest valid value or null if none is set.
-
getUpperLimit
Get the highest valid value of the parameter.- Returns:
- Highest valid value or null if none is set.
-