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

public Class NegativeOrZeroValidatorForFloat

extends Object
implements ConstraintValidator<NegativeOrZero, Float>
Class Inheritance
All Implemented Interfaces
jakarta.validation.ConstraintValidator
Imports
jakarta.validation.ConstraintValidator, .ConstraintValidatorContext, jakarta.validation.constraints.NegativeOrZero, org.hibernate.validator.internal.constraintvalidators.bv.number.InfinityNumberComparatorHelper

Check that the number being validated is negative 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(Float
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

NegativeOrZeroValidatorForFloatback to summary
public NegativeOrZeroValidatorForFloat()

Method Detail

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

object to validate

context:ConstraintValidatorContext

context in which the constraint is evaluated

Returns:boolean

false if value does not pass the constraint

Annotations
@Override