Package jakarta.validation
Interface ConstraintValidatorContext.ConstraintViolationBuilder.LeafNodeContextBuilder
- Enclosing interface:
ConstraintValidatorContext.ConstraintViolationBuilder
public static interface ConstraintValidatorContext.ConstraintViolationBuilder.LeafNodeContextBuilder
Represents refinement choices for a node which is
in an iterable, e.g. array,
Iterable or Map.
If the iterable is an indexed collection or a map, the index or the key should be set.
The node is a leaf node (i.e. no subnode can be added).
- Since:
- 1.1
-
Method Summary
Modifier and TypeMethodDescriptionAdds the newConstraintViolationto be generated if the constraint validator mark the value as invalid.Defines the index the object is into theListor arrayDefines the key the object is into theMap.
-
Method Details
-
atKey
ConstraintValidatorContext.ConstraintViolationBuilder.LeafNodeBuilderDefinedContext atKey(Object key) Defines the key the object is into theMap.- Parameters:
key- map key- Returns:
- a builder representing the current node
-
atIndex
ConstraintValidatorContext.ConstraintViolationBuilder.LeafNodeBuilderDefinedContext atIndex(Integer index) Defines the index the object is into theListor array- Parameters:
index- index- Returns:
- a builder representing the current node
-
addConstraintViolation
ConstraintValidatorContext addConstraintViolation()Adds the newConstraintViolationto be generated if the constraint validator mark the value as invalid.Methods of the
ConstraintViolationBuilderinstance this object comes from and the constraint violation builder nested objects throwIllegalStateExceptionafter this call.- Returns:
ConstraintValidatorContextinstance theConstraintViolationBuildercomes from
-