Class NegativeValidatorForCharSequence

java.lang.Object
org.hibernate.validator.internal.constraintvalidators.bv.number.sign.NegativeValidatorForCharSequence
All Implemented Interfaces:
ConstraintValidator<Negative,CharSequence>

public class NegativeValidatorForCharSequence extends Object implements ConstraintValidator<Negative,CharSequence>
Check that the number being validated is negative.
Author:
Guillaume Smet
  • Constructor Details

    • NegativeValidatorForCharSequence

      public NegativeValidatorForCharSequence()
  • Method Details

    • isValid

      public boolean isValid(CharSequence value, ConstraintValidatorContext context)
      Description copied from interface: ConstraintValidator
      Implements the validation logic. The state of value must not be altered.

      This method can be accessed concurrently, thread-safety must be ensured by the implementation.

      Specified by:
      isValid in interface ConstraintValidator<Negative,CharSequence>
      Parameters:
      value - object to validate
      context - context in which the constraint is evaluated
      Returns:
      false if value does not pass the constraint