List of usage examples for java.time Period isZero
public boolean isZero()
From source file:Main.java
public static void main(String[] args) { Period p = Period.ofMonths(1); System.out.println(p.isZero()); }
From source file:Main.java
@Override public LocalDate queryFrom(TemporalAccessor temporal) { LocalDate date = LocalDate.from(temporal); LocalDate currentYearMLKDay = getMartinLutherKingDayForDateInYear(date.getYear()); Period periodToCurrentYearMLKDay = Period.between(date, currentYearMLKDay); if (periodToCurrentYearMLKDay.isNegative() || periodToCurrentYearMLKDay.isZero()) { return getMartinLutherKingDayForDateInYear(date.getYear() + 1); } else {//from www .j av a 2 s .com return currentYearMLKDay; } }