public boolean isCoverableBy(Set<UpdatePeriod> updatePeriods) { return DateUtil.isCoverableBy(fromDate, toDate, updatePeriods); }
public boolean isCoverableBy(Set<UpdatePeriod> updatePeriods) { return DateUtil.isCoverableBy(fromDate, toDate, updatePeriods); }
/** * Whether the range [from,to) is coverable by intervals * @param from from time * @param to to time * @param intervals intervals to check * @return true if any of the intervals can completely cover the range */ static boolean isCoverableBy(Date from, Date to, Set<UpdatePeriod> intervals) { return intervals.stream().anyMatch(period->isCoverableBy(from, to, period)); } private static boolean isCoverableBy(Date from, Date to, UpdatePeriod period) {
/** * Whether the range [from,to) is coverable by intervals * @param from from time * @param to to time * @param intervals intervals to check * @return true if any of the intervals can completely cover the range */ static boolean isCoverableBy(Date from, Date to, Set<UpdatePeriod> intervals) { return intervals.stream().anyMatch(period->isCoverableBy(from, to, period)); } private static boolean isCoverableBy(Date from, Date to, UpdatePeriod period) {