@FunctionalInterface public interface ChronoCondition<T> extends Predicate<T>
Represents a temporal condition.
Common examples are queries for Friday the thirteenth or if a date
matches a holiday or a weekend. This interface is very similar to the
type ChronoQuery<T, Boolean> but allows more clarity and does
not throw any exception.
ChronoEntity.matches(ChronoCondition)| Modifier and Type | Method and Description |
|---|---|
boolean |
test(T context)
Decides if given context matches this condition.
|
boolean test(T context)
Decides if given context matches this condition.
Due to better readability it is recommended to use following equivalent approach instead of this method::
import static net.time4j.Weekday.SATURDAY; import static net.time4j.Month.JANUARY; PlainDate date = PlainDate.of(2014, JANUARY, 25); System.out.println(SATURDAY.test(date)); // direct use System.out.println(date.matches(SATURDAY)); // recommended callback
Copyright © 2014–2017. All rights reserved.