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 newConstraintViolation
to be generated if the constraint validator mark the value as invalid.Defines the index the object is into theList
or 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 theList
or array- Parameters:
index
- index- Returns:
- a builder representing the current node
-
addConstraintViolation
ConstraintValidatorContext addConstraintViolation()Adds the newConstraintViolation
to be generated if the constraint validator mark the value as invalid.Methods of the
ConstraintViolationBuilder
instance this object comes from and the constraint violation builder nested objects throwIllegalStateException
after this call.- Returns:
ConstraintValidatorContext
instance theConstraintViolationBuilder
comes from
-