コード例 #1
0
 // Alternatively, if you don't like infinite streams...
 public static TemporalAdjuster next_oldschool(Predicate<LocalDate> p) {
   return TemporalAdjusters.ofDateAdjuster(
       (d) -> {
         LocalDate currentToTest = nextDay(d);
         while (!p.test(currentToTest)) {
           currentToTest = nextDay(currentToTest);
         }
         return currentToTest;
       });
 }
コード例 #2
0
 public static TemporalAdjuster next(Predicate<LocalDate> p) {
   return TemporalAdjusters.ofDateAdjuster(
       (d) -> Stream.iterate(nextDay(d), Ex3::nextDay).filter(p).findFirst().get());
 }