@FunctionalInterface public interface DayPartitionRule
Represents a rule how to partition a day into disjunct clock intervals.
DayPartitionBuilder,
DateInterval.streamPartitioned(DayPartitionRule)| Modifier and Type | Method and Description |
|---|---|
default DayPartitionRule |
and(DayPartitionRule rule)
Combines this rule with another one.
|
List<ChronoInterval<PlainTime>> |
getPartition(PlainDate date)
Obtains the partitions for given date if defined.
|
default boolean |
isExcluded(PlainDate date)
Determines if given date is excluded from creating day partitions.
|
default boolean |
matches(PlainTimestamp timestamp)
Does this rule match given timestamp such that any rule interval contains it?
|
List<ChronoInterval<PlainTime>> getPartition(PlainDate date)
Obtains the partitions for given date if defined.
date - the calendar date to be queriedClockInterval.comparator()default DayPartitionRule and(DayPartitionRule rule)
Combines this rule with another one.
The new rule will never take into account dates which are excluded by either this rule or the given one.
rule - another day partition rule to be combined with this oneisExcluded(PlainDate)default boolean isExcluded(PlainDate date)
Determines if given date is excluded from creating day partitions.
The default implementation is equivalent to getPartition(date).isEmpty().
date - the calendar date to be checked for exclusiondefault boolean matches(PlainTimestamp timestamp)
Does this rule match given timestamp such that any rule interval contains it?
Example: If this rule describes shop opening times then this method yields the answer to the question if the shop is open at given timestamp.
timestamp - the timestamp to be checkedtrue if given timestamp fits to this rule else falseCopyright © 2014–2018. All rights reserved.