Class ConstraintPhone

java.lang.Object
io.vertigo.easyforms.runner.pack.constraint.ConstraintPhone
All Implemented Interfaces:
io.vertigo.datamodel.smarttype.definitions.Constraint<String,String>

public final class ConstraintPhone extends Object implements io.vertigo.datamodel.smarttype.definitions.Constraint<String,String>
Phone white lists.
Author:
skerdudou
  • Constructor Details

    • ConstraintPhone

      public ConstraintPhone(String patternsOrCodes, Optional<String> overrideMessageOpt, Optional<String> overrideResourceMessageOpt)
      Parameters:
      patternsOrCodes - List of codes from ConstraintPhoneEnum or pattern in xxx:yy format for a new PhonePattern(xxx, yy). All separated by ';'.
  • Method Details

    • ofEnum

      public static ConstraintPhone ofEnum(ConstraintPhone.ConstraintPhoneEnum phonePatterns, Optional<String> overrideMessageOpt, Optional<String> overrideResourceMessageOpt)
    • ofEnums

      public static ConstraintPhone ofEnums(List<ConstraintPhone.ConstraintPhoneEnum> phonePatterns, Optional<String> overrideMessageOpt, Optional<String> overrideResourceMessageOpt)
    • checkConstraint

      public boolean checkConstraint(String value)
      Specified by:
      checkConstraint in interface io.vertigo.datamodel.smarttype.definitions.Constraint<String,String>
    • getErrorMessage

      public io.vertigo.core.locale.LocaleMessageText getErrorMessage()
      Specified by:
      getErrorMessage in interface io.vertigo.datamodel.smarttype.definitions.Constraint<String,String>
    • getProperty

      public io.vertigo.datamodel.smarttype.definitions.Property getProperty()
      Specified by:
      getProperty in interface io.vertigo.datamodel.smarttype.definitions.Constraint<String,String>
    • getPropertyValue

      public String getPropertyValue()
      Specified by:
      getPropertyValue in interface io.vertigo.datamodel.smarttype.definitions.Constraint<String,String>
    • getRegex

      public String getRegex()
      Returns:
      Expression régulière testée par la contrainte