Top Description Constructors Methods
org.hibernate.validator.internal.constraintvalidators.bv.number.sign

public Class NegativeValidatorForNumber

extends Object
implements ConstraintValidator<Negative, Number>
Class Inheritance
All Implemented Interfaces
jakarta.validation.ConstraintValidator
Imports
jakarta.validation.ConstraintValidator, .ConstraintValidatorContext, jakarta.validation.constraints.Negative

Check that the number being validated is negative.
Authors
Hardy Ferentschik, Xavier Sosnovsky, Guillaume Smet, Marko Bekhta

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
isValid(Number
object to validate
value
,
ConstraintValidatorContext
context in which the constraint is evaluated
context
)

Implements jakarta.validation.ConstraintValidator.isValid.

Implements the validation logic.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

NegativeValidatorForNumberback to summary
public NegativeValidatorForNumber()

Method Detail

isValidback to summary
public boolean isValid(Number value, ConstraintValidatorContext context)

Implements jakarta.validation.ConstraintValidator.isValid.

Doc from jakarta.validation.ConstraintValidator.isValid.

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.

Parameters
value:Number

object to validate

context:ConstraintValidatorContext

context in which the constraint is evaluated

Returns:boolean

false if value does not pass the constraint

Annotations
@Override