public interface ChronoCondition<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)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
context - context as base of testing this conditiontrue if given time context matches this condition
else falseCopyright © 2014. All rights reserved.