V
- The type of value to be validatedpublic abstract class NotEmptyConstraint<V> extends CheckConstraint<V>
CheckConstraint
that checks whether a value is not empty.NotEmpty
Modifier and Type | Class and Description |
---|---|
static class |
NotEmptyConstraint.ArrayType
This class provides
NotEmptyConstraint implementation for
all array types. |
static class |
NotEmptyConstraint.CollectionType
This class provides
NotEmptyConstraint implementation for
all JDK java.util.Collection types. |
static class |
NotEmptyConstraint.MapType
This class provides
NotEmptyConstraint implementation for
all JDK java.util.Map types. |
static class |
NotEmptyConstraint.StringType
This class provides
NotEmptyConstraint implementation for
java.lang.String type. |
Constructor and Description |
---|
NotEmptyConstraint() |
Modifier and Type | Method and Description |
---|---|
protected <T> boolean |
check(V value,
ValidationContext<T> context)
Checks whether the specified value is not empty.
|
String |
getMessageTemplate(ValidationContext<?> context)
Returns localized error message template.
|
protected abstract <T> boolean |
isEmpty(V value,
ValidationContext<T> context)
Determines whether the specified value is empty.
|
validate
appendMessageArguments
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
appendMessageArguments, getType
public String getMessageTemplate(ValidationContext<?> context)
getMessageTemplate
in interface Constraint<V>
getMessageTemplate
in interface Validation<V>
getMessageTemplate
in class AbstractValidation<V>
context
- Validation context.protected final <T> boolean check(V value, ValidationContext<T> context)
check
in class CheckConstraint<V>
T
- The type of validated entity.value
- Value to be checked for empty.context
- Validation context.true
if the specified value is not empty;
false
otherwise.protected abstract <T> boolean isEmpty(V value, ValidationContext<T> context)
T
- The type of validated entity.value
- Value to be checked for empty.context
- Validation context.true
if the specified value is empty;
false
otherwise.Copyright © 2011–2020 FoxLabs. All rights reserved.