Package io.vertigo.basics.constraint
Class ConstraintIntegerLength
- java.lang.Object
-
- io.vertigo.basics.constraint.ConstraintIntegerLength
-
- All Implemented Interfaces:
Constraint<Integer,Integer>
public final class ConstraintIntegerLength extends Object
Contrainte vérifiant que l'objet est :- soit un Integer comprenant au maximum le nombre de chiffres précisé à la construction (nombres de digits)
- soit null
On rappelle que le maximum d'un type Integer est compris entre 1O^9 et 10^10
On conseille donc d'utiliser 10^9 comme structure de stockage max en BDD : donc number(9)
Si vous souhaitez flirter avec les 10^10 alors n'utilisez pas de contraintes.- Author:
- pchretien
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkConstraint(Integer value)
io.vertigo.core.locale.MessageText
getErrorMessage()
int
getMaxLength()
Property
getProperty()
Integer
getPropertyValue()
-
-
-
Constructor Detail
-
ConstraintIntegerLength
public ConstraintIntegerLength(String args, Optional<String> overrideMessageOpt, Optional<String> overrideResourceMessageOpt)
Constructeur nécessaire pour le ksp.- Parameters:
args
- Liste des arguments réduite à un seul castable en integer. Cet argument correspond au nombre de chifres maximum authorisé sur le Integer.
-
-
Method Detail
-
checkConstraint
public boolean checkConstraint(Integer value)
-
getErrorMessage
public io.vertigo.core.locale.MessageText getErrorMessage()
-
getMaxLength
public final int getMaxLength()
- Returns:
- int Nombre maximum de caractères, de chiffres...
-
getProperty
public final Property getProperty()
- Specified by:
getProperty
in interfaceConstraint<Integer,D>
-
getPropertyValue
public final Integer getPropertyValue()
- Specified by:
getPropertyValue
in interfaceConstraint<Integer,D>
-
-