public final class SysdateConstraint extends CorrectConstraint<Date>
CorrectConstraint
implementation that
replaces a null
date with current system date.Sysdate
,
ConstraintFactory.sysdate()
Modifier and Type | Field and Description |
---|---|
static SysdateConstraint |
DEFAULT
SysdateConstraint single instance. |
Modifier and Type | Method and Description |
---|---|
Class<?> |
getType()
Returns
java.util.Date type. |
<T> Date |
validate(Date value,
ValidationContext<T> context)
Returns current system date if the specified date is
null ;
returns date as is otherwise. |
getMessageTemplate
appendMessageArguments
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
appendMessageArguments
public static final SysdateConstraint DEFAULT
SysdateConstraint
single instance.public Class<?> getType()
java.util.Date
type.java.util.Date
type.public <T> Date validate(Date value, ValidationContext<T> context)
null
;
returns date as is otherwise.T
- The type of validated entity.value
- Date to be tested for null
.context
- Validation context.null
;
date as is otherwise.Copyright © 2011–2020 FoxLabs. All rights reserved.