Class VesselIMOValidator
java.lang.Object
org.apache.commons.validator.routines.VesselIMOValidator
- All Implemented Interfaces:
Serializable
Vessel IMO Number validation.
IMO Numbers are unique identification numbers used to identify vessels.
Check digit calculation is based on modulus 10 with digits being weighted based on their position (from right to left).
For further information see Wikipedia - IMO Number.
- Since:
- 1.9.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic VesselIMOValidatorGets the singleton instance of this validator.booleanTests whether the code is a valid IMO number.Checks the code is valid IMO number.
-
Method Details
-
getInstance
Gets the singleton instance of this validator.- Returns:
- A singleton instance of the IMO Number validator.
-
isValid
Tests whether the code is a valid IMO number.- Parameters:
code- The code to validate.- Returns:
trueif a IMO number, otherwisefalse.
-
validate
Checks the code is valid IMO number.- Parameters:
code- The code to validate.- Returns:
- A IMO number code with prefix removed if valid, otherwise
null.
-