Package net.time4j.engine
Interface ChronoCondition<T>
- All Superinterfaces:
Predicate<T>
- All Known Subinterfaces:
HolidayModel
- All Known Implementing Classes:
CopticMonth
,EthiopianMonth
,HebrewMonth
,HijriMonth
,HinduDay
,HinduMonth
,IndianMonth
,Meridiem
,Month
,Nengo.Selector
,PersianMonth
,Quarter
,Weekday
,Zodiac.Event
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
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.
- Author:
- Meno Hochschild
- See Also:
ChronoEntity.matches(ChronoCondition)
-
Method Summary
-
Method Details
-
test
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
-