@Documented @Constraint(validatedBy={HourNotInValidator.ForDate.class,HourNotInValidator.ForCalendar.class,HourNotInValidator.ForInstant.class,HourNotInValidator.ForLocalDateTime.class,HourNotInValidator.ForLocalTime.class,HourNotInValidator.ForOffsetDateTime.class,HourNotInValidator.ForOffsetTime.class,HourNotInValidator.ForZonedDateTime.class}) @Target(value={METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER,TYPE_USE}) @Retention(value=RUNTIME) @Repeatable(value=HourNotIn.List.class) public @interface HourNotIn
object
, validates that !value.contains(object.hour)
.
Supported types are:
null
elements are considered valid.
Modifier and Type | Required Element and Description |
---|---|
int[] |
value
The disallowed hours.
|
public abstract String message
public abstract Class<?>[] groups
public abstract String zoneId
system
for the value returned by ZoneId.systemDefault()
, provided
for the zone id
from the actual value, or otherwise a value that is accepted by ZoneId.of(String)
for a specific zone id.
Calendar
, OffsetDateTime
and ZonedDateTime
, if the zone id is not
provided
, the value is converted to the given zone id before extracting the hour.OffsetTime
, if the zone id is not provided
, the value is converted to the current date at the the given zone
id before extracting the hour.Date
and Instant
, no zone id is available, so provided
is not allowed.LocalDateTime
and LocalTime
, no zone id is applicable, so only the default value (system
)
is allowed.Copyright © 2021–2022. All rights reserved.