@Test public void testToStringWithNull() throws Exception { assertEquals("[null:null]", DateRange.OPEN_RANGE.toString()); }
@Override public String toString() { String startString = startDate != null ? DATE_FORMAT.format(startDate) : "null"; String stopString = stopDate != null ? DATE_FORMAT.format(stopDate) : "null"; return OPENING_BRACKET + startString + SEPARATOR + stopString + CLOSING_BRACKET; }
DateRange { @Override public String toString() { String startString = startDate != null ? DATE_FORMAT.format(startDate) : "null"; String stopString = stopDate != null ? DATE_FORMAT.format(stopDate) : "null"; return OPENING_BRACKET + startString + SEPARATOR + stopString + CLOSING_BRACKET; } }
DateRange { @Override public String toString() { String startString = startDate != null ? DATE_FORMAT.format(startDate) : "null"; String stopString = stopDate != null ? DATE_FORMAT.format(stopDate) : "null"; return OPENING_BRACKET + startString + SEPARATOR + stopString + CLOSING_BRACKET; } DateRange(Date startDate, Date stopDate); }
DateRange { @Override public String toString() { String startString = startDate != null ? DATE_FORMAT.format(startDate) : "null"; String stopString = stopDate != null ? DATE_FORMAT.format(stopDate) : "null"; return OPENING_BRACKET + startString + SEPARATOR + stopString + CLOSING_BRACKET; } DateRange(Date startDate, Date stopDate); Date getStartDate(); Date getStopDate(); @Override String toString(); static DateRange parseDateRange(String dateRange); }
DateRange { @Override public String toString() { String startString = startDate != null ? DATE_FORMAT.format(startDate) : "null"; String stopString = stopDate != null ? DATE_FORMAT.format(stopDate) : "null"; return OPENING_BRACKET + startString + SEPARATOR + stopString + CLOSING_BRACKET; } DateRange(Date startDate, Date stopDate); Date getStartDate(); Date getStopDate(); @Override String toString(); static DateRange parseDateRange(String dateRange); static final DateRange OPEN_RANGE; static final DateFormat DATE_FORMAT; }