Uploaded image for project: 'Bean Validation'
  1. BVAL-192

Add 'exclusive' boolean attribute to @DecimalMin/@DecimalMax constraints

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0 final
    • Fix Version/s: 1.1.0.Beta3
    • Component/s: spec-general
    • Labels:
      None
    • Environment:
      Hibernate Validator 4.0.0.GA
    • Last commented by a user?:
      true

      Description

      Hi, may I suggest to enhance @DecimalMin/@DecimalMax constraints with additional exclusive boolean attribute? This would allow to define a constraints like:

      // a positive non-zero decimal number
      @DecimalMin(value = "0.0", exclusive = true)
      
      // a negative non-zero decimal number
      @DecimalMax(value = "0.0", exclusive = true)
      

      This makes sense when dealing with decimal numbers where one might want to allow a number regardless of the precision.
      @DecimalMin("0.0001") vs. @DecimalMin("0.000000001"), etc.

      To maintain backward compatibility, default value for new exclusive boolean attribute should be false

        Attachments

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: