@Test public void shouldAdjustLocalDateWithTwoDigitYears() { assertThat(ADJUSTER.adjustInto(localDateWithYear(00))).isEqualTo(localDateWithYear(2000)); assertThat(ADJUSTER.adjustInto(localDateWithYear(01))).isEqualTo(localDateWithYear(2001)); assertThat(ADJUSTER.adjustInto(localDateWithYear(10))).isEqualTo(localDateWithYear(2010)); assertThat(ADJUSTER.adjustInto(localDateWithYear(69))).isEqualTo(localDateWithYear(2069)); assertThat(ADJUSTER.adjustInto(localDateWithYear(70))).isEqualTo(localDateWithYear(1970)); assertThat(ADJUSTER.adjustInto(localDateWithYear(71))).isEqualTo(localDateWithYear(1971)); assertThat(ADJUSTER.adjustInto(localDateWithYear(99))).isEqualTo(localDateWithYear(1999)); }
@Test public void shouldAdjustLocalDateTimeWithTwoDigitYears() { assertThat(ADJUSTER.adjustInto(localDateTimeWithYear(00))).isEqualTo(localDateTimeWithYear(2000)); assertThat(ADJUSTER.adjustInto(localDateTimeWithYear(01))).isEqualTo(localDateTimeWithYear(2001)); assertThat(ADJUSTER.adjustInto(localDateTimeWithYear(10))).isEqualTo(localDateTimeWithYear(2010)); assertThat(ADJUSTER.adjustInto(localDateTimeWithYear(69))).isEqualTo(localDateTimeWithYear(2069)); assertThat(ADJUSTER.adjustInto(localDateTimeWithYear(70))).isEqualTo(localDateTimeWithYear(1970)); assertThat(ADJUSTER.adjustInto(localDateTimeWithYear(71))).isEqualTo(localDateTimeWithYear(1971)); assertThat(ADJUSTER.adjustInto(localDateTimeWithYear(99))).isEqualTo(localDateTimeWithYear(1999)); }
@Test public void shouldNotAdjustLocalDateWithThreeDigitYears() { assertThat(ADJUSTER.adjustInto(localDateWithYear(-1))).isEqualTo(localDateWithYear(-1)); assertThat(ADJUSTER.adjustInto(localDateWithYear(100))).isEqualTo(localDateWithYear(100)); }
@Test public void shouldNotAdjustLocalDateTimeWithThreeDigitYears() { assertThat(ADJUSTER.adjustInto(localDateTimeWithYear(-1))).isEqualTo(localDateTimeWithYear(-1)); assertThat(ADJUSTER.adjustInto(localDateTimeWithYear(100))).isEqualTo(localDateTimeWithYear(100)); }
@SuppressWarnings("unchecked") public T enforce(final T object) { if (myAdjuster != null) { return (T) myAdjuster.adjustInto(object); } else { return object; } }
@SuppressWarnings("unchecked") public T enforce(final T object) { if (myAdjuster != null) { return (T) myAdjuster.adjustInto(object); } else { return object; } }
@Override public DiscordianDate with(TemporalAdjuster adjuster) { return (DiscordianDate) adjuster.adjustInto(this); }
@Override public Symmetry010Date with(TemporalAdjuster adjuster) { return (Symmetry010Date) adjuster.adjustInto(this); }
@Override public Symmetry454Date with(TemporalAdjuster adjuster) { return (Symmetry454Date) adjuster.adjustInto(this); }
@Override public JulianDate with(TemporalAdjuster adjuster) { return (JulianDate) adjuster.adjustInto(this); }
@Override public BritishCutoverDate with(TemporalAdjuster adjuster) { return (BritishCutoverDate) adjuster.adjustInto(this); }
@Override public PaxDate with(TemporalAdjuster adjuster) { return (PaxDate) adjuster.adjustInto(this); }
@Override public AccountingDate with(TemporalAdjuster adjuster) { return (AccountingDate) adjuster.adjustInto(this); }
@Override public Temporal with(TemporalAdjuster adjuster) { return adjuster.adjustInto(this); }
@Override public CopticDate with(TemporalAdjuster adjuster) { return (CopticDate) adjuster.adjustInto(this); }
@Override public ChronoLocalDateTimeImpl<D> with(TemporalAdjuster adjuster) { if (adjuster instanceof ChronoLocalDate) { // The Chrono is checked in with(date,time) return with((ChronoLocalDate) adjuster, time); } else if (adjuster instanceof LocalTime) { return with(date, (LocalTime) adjuster); } else if (adjuster instanceof ChronoLocalDateTimeImpl) { return date.getChronology().ensureChronoLocalDateTime((ChronoLocalDateTimeImpl<?>) adjuster); } return date.getChronology().ensureChronoLocalDateTime((ChronoLocalDateTimeImpl<?>) adjuster.adjustInto(this)); }
@Test public void shouldAdjustLocalDateWithTwoDigitYears() { assertThat(ADJUSTER.adjustInto(localDateWithYear(00))).isEqualTo(localDateWithYear(2000)); assertThat(ADJUSTER.adjustInto(localDateWithYear(01))).isEqualTo(localDateWithYear(2001)); assertThat(ADJUSTER.adjustInto(localDateWithYear(10))).isEqualTo(localDateWithYear(2010)); assertThat(ADJUSTER.adjustInto(localDateWithYear(69))).isEqualTo(localDateWithYear(2069)); assertThat(ADJUSTER.adjustInto(localDateWithYear(70))).isEqualTo(localDateWithYear(1970)); assertThat(ADJUSTER.adjustInto(localDateWithYear(71))).isEqualTo(localDateWithYear(1971)); assertThat(ADJUSTER.adjustInto(localDateWithYear(99))).isEqualTo(localDateWithYear(1999)); }
@Test public void shouldAdjustLocalDateTimeWithTwoDigitYears() { assertThat(ADJUSTER.adjustInto(localDateTimeWithYear(00))).isEqualTo(localDateTimeWithYear(2000)); assertThat(ADJUSTER.adjustInto(localDateTimeWithYear(01))).isEqualTo(localDateTimeWithYear(2001)); assertThat(ADJUSTER.adjustInto(localDateTimeWithYear(10))).isEqualTo(localDateTimeWithYear(2010)); assertThat(ADJUSTER.adjustInto(localDateTimeWithYear(69))).isEqualTo(localDateTimeWithYear(2069)); assertThat(ADJUSTER.adjustInto(localDateTimeWithYear(70))).isEqualTo(localDateTimeWithYear(1970)); assertThat(ADJUSTER.adjustInto(localDateTimeWithYear(71))).isEqualTo(localDateTimeWithYear(1971)); assertThat(ADJUSTER.adjustInto(localDateTimeWithYear(99))).isEqualTo(localDateTimeWithYear(1999)); }
@Test public void shouldNotAdjustLocalDateWithThreeDigitYears() { assertThat(ADJUSTER.adjustInto(localDateWithYear(-1))).isEqualTo(localDateWithYear(-1)); assertThat(ADJUSTER.adjustInto(localDateWithYear(100))).isEqualTo(localDateWithYear(100)); }
@Test public void shouldNotAdjustLocalDateTimeWithThreeDigitYears() { assertThat(ADJUSTER.adjustInto(localDateTimeWithYear(-1))).isEqualTo(localDateTimeWithYear(-1)); assertThat(ADJUSTER.adjustInto(localDateTimeWithYear(100))).isEqualTo(localDateTimeWithYear(100)); }