static Predicate < DateValue > byMinuteFilter ( int [ ] minutes ) { long minutesByBit = 0 ; for ( int minute : minutes ) { minutesByBit |= 1L << minute ; } if ( ( minutesByBit & LOW_60_BITS ) == LOW_60_BITS ) { return Predicates . alwaysTrue ( ) ; } final long bitField = minutesByBit ; return new Predicate < DateValue > ( ) { public boolean apply ( DateValue date ) { if ( ! ( date instanceof TimeValue ) ) { return false ; } TimeValue tv = ( TimeValue ) date ; return ( bitField & ( 1L << tv . minute ( ) ) ) != 0 ; } } ; }
constructs a minute filter based on a BYMINUTE rule .