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

public Class PositiveOrZeroValidatorForBigDecimal

extends Object
implements ConstraintValidator<PositiveOrZero, BigDecimal>
Class Inheritance
All Implemented Interfaces
jakarta.validation.ConstraintValidator
Imports
java.math.BigDecimal, jakarta.validation.ConstraintValidator, .ConstraintValidatorContext, jakarta.validation.constraints.PositiveOrZero

Check that the number being validated is positive or zero.
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(BigDecimal
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

PositiveOrZeroValidatorForBigDecimalback to summary
public PositiveOrZeroValidatorForBigDecimal()

Method Detail

isValidback to summary
public boolean isValid(BigDecimal 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:BigDecimal

object to validate

context:ConstraintValidatorContext

context in which the constraint is evaluated

Returns:boolean

false if value does not pass the constraint

Annotations
@Override