Class ConstraintLongLength

java.lang.Object
io.vertigo.basics.constraint.ConstraintLongLength
All Implemented Interfaces:
Constraint<Integer,Long>

public final class ConstraintLongLength extends Object
Contrainte vérifiant que l'objet est :
  • soit un Long comprenant au maximum le nombre de chiffres précisé à la construction (nombres de digits)
  • soit null

On rappelle que le maximum d'un type Long est compris entre 1O^18 et 10^19
On conseille donc d'utiliser 10^18 comme structure de stockage max en BDD : donc number(18)
Si vous souhaitez flirter avec les 10^19 alors n'utilisez pas de contraintes.
Author:
pchretien
  • Constructor Details

    • ConstraintLongLength

      public ConstraintLongLength(String args, Optional<String> overrideMessageOpt, Optional<String> overrideResourceMessageOpt)
      Parameters:
      args - Liste des arguments réduite à un seul castable en long. Cet argument correspond au nombre de chifres maximum authorisé sur le Long.
  • Method Details

    • checkConstraint

      public boolean checkConstraint(Long value)
    • getErrorMessage

      public io.vertigo.core.locale.LocaleMessageText getErrorMessage()
    • getMaxLength

      public final int getMaxLength()
      Returns:
      int Nombre maximum de caractères, de chiffres...
    • getProperty

      public final Property getProperty()
      Specified by:
      getProperty in interface Constraint<Integer,D>
    • getPropertyValue

      public final Integer getPropertyValue()
      Specified by:
      getPropertyValue in interface Constraint<Integer,D>