Class FieldValidatorSupport<O,F>
- java.lang.Object
-
- io.ultreia.java4all.validation.impl.field.FieldValidatorSupport<O,F>
-
- All Implemented Interfaces:
FieldValidator<O,F>
- Direct Known Subclasses:
SkipableFieldValidatorSupport
public abstract class FieldValidatorSupport<O,F> extends Object implements FieldValidator<O,F>
Created on 26/01/2024.- Since:
- 2.0.0
- Author:
- Tony Chemit - dev@tchemit.fr
-
-
Constructor Summary
Constructors Constructor Description FieldValidatorSupport(String fieldName, Function<O,F> fieldFunction)FieldValidatorSupport(String fieldName, Function<O,F> fieldFunction, String messageKey, MessageBuilder<O,? super NuitonValidationContext,? super FieldValidator<O,?>> messageBuilder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Function<O,F>fieldFunction()FgetField(O object)StringgetFieldName()StringgetMessage(O object, NuitonValidationContext validationContext)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.ultreia.java4all.validation.impl.field.FieldValidator
addMessage, validate
-
-
-
-
Constructor Detail
-
FieldValidatorSupport
public FieldValidatorSupport(String fieldName, Function<O,F> fieldFunction, String messageKey, MessageBuilder<O,? super NuitonValidationContext,? super FieldValidator<O,?>> messageBuilder)
-
-
Method Detail
-
getFieldName
public String getFieldName()
- Specified by:
getFieldNamein interfaceFieldValidator<O,F>- Returns:
- the field name of the object to validate.
-
getField
public F getField(O object)
- Specified by:
getFieldin interfaceFieldValidator<O,F>- Parameters:
object- object to validate- Returns:
- the field of the object to validate
-
getMessage
public String getMessage(O object, NuitonValidationContext validationContext)
- Specified by:
getMessagein interfaceFieldValidator<O,F>- Parameters:
object- object to validatevalidationContext- to get access to outside world- Returns:
- the validation message
-
-