Class FloatPrecisionValidator

All Implemented Interfaces:
HasHandlers

public class FloatPrecisionValidator extends Validator
Tests whether the value for this field is a floating point number with the appropriate number of decimal places - specified in validator.precision If the value is of higher precision, if validator.roundToPrecision is specified, the value will be rounded to the specified number of decimal places and validation will pass, otherwise validation will fail.
  • Constructor Details

    • FloatPrecisionValidator

      public FloatPrecisionValidator()
  • Method Details

    • setPrecision

      public void setPrecision(int precision)
      Set the precision.
      Parameters:
      precision - the precision
    • getPrecision

      public int getPrecision()
      Return the precision.
      Returns:
      the precision
    • setRoundToPrecision

      public void setRoundToPrecision(int roundToPrecision)
      Set the roundToPrecision.
      Parameters:
      roundToPrecision - the roundToPrecision
    • getRoundToPrecision

      public int getRoundToPrecision()
      Return the roundToPrecision.
      Returns:
      the roundToPrecision