Class ConstraintBigDecimal

java.lang.Object
io.vertigo.basics.constraint.ConstraintBigDecimal
All Implemented Interfaces:
io.vertigo.datamodel.smarttype.definitions.Constraint<String,BigDecimal>

public final class ConstraintBigDecimal extends Object implements io.vertigo.datamodel.smarttype.definitions.Constraint<String,BigDecimal>
Manage BigDecimal's constraints. The configuration is like the configuration of Database's decimal (DECIMAL(M,D)). Where M is the maximum of digits (the precision) and D is the number of digits to the right of the decimal point (the scale). The maximum number of digits to the left of the decimal point is check too and must be less than M-D.
Author:
mlaroche
  • Constructor Details

    • ConstraintBigDecimal

      public ConstraintBigDecimal(String args, Optional<String> overrideMessageOpt, Optional<String> overrideResourceMessageOpt)
      Initialise les paramètres.
      Parameters:
      args - args but no args
  • Method Details

    • checkConstraint

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

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

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

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