public final class TrimConstraint extends CorrectConstraint<String>
CorrectConstraint
implementation that
removes leading and trailing whitespaces from a string.Trim
,
ConstraintFactory.trim()
Modifier and Type | Field and Description |
---|---|
static TrimConstraint |
DEFAULT
TrimConstraint single instance. |
Modifier and Type | Method and Description |
---|---|
Class<?> |
getType()
Returns
java.lang.String type. |
<T> String |
validate(String value,
ValidationContext<T> context)
Returns the specified string with no leading and trailing whitespaces.
|
getMessageTemplate
appendMessageArguments
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
appendMessageArguments
public static final TrimConstraint DEFAULT
TrimConstraint
single instance.public Class<?> getType()
java.lang.String
type.java.lang.String
type.public <T> String validate(String value, ValidationContext<T> context)
T
- The type of validated entity.value
- String to be trimmed.context
- Validation context.Copyright © 2011–2020 FoxLabs. All rights reserved.