Package com.jbstrap.core.validators
Class LongValidator
java.lang.Object
com.jbstrap.core.validators.LongValidator
- All Implemented Interfaces:
DataValidator
The long validator class
- Since:
- 4.0
- Author:
- JBStrap
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvalidateData
(Object data, String language) Validates the specified value
-
Constructor Details
-
LongValidator
public LongValidator()
-
-
Method Details
-
validateData
Validates the specified value
The specified value will be validated, if it can be converted into a Long type
The error message, returned by the method can be customized or have its language set in the
validator.longValidatorError
properties file with the use of a key. For more information about language settings, see theMessageSourceAPI
class- Specified by:
validateData
in interfaceDataValidator
- Parameters:
data
- The data to be validatedlanguage
- The language code of the error message. If not specified, the default language will be used. The default language can be set with theDEFAULT_LANGUAGE
JBStrap parameter.- Returns:
- The specified error message or
null
, if the validation found no errors.
-