@Test public void ambigousDateTest() { TemporalRangeParser trp = TemporalRangeParser.builder().create(); EventRange range = trp.parse("01/02/1999"); assertTrue(range.hasIssues()); assertEquals(1, range.getIssues().size()); assertTrue(range.getIssues().contains(OccurrenceIssue.RECORDED_DATE_INVALID)); range = trp.parse("1999-01-02"); assertFalse(range.hasIssues()); assertEquals("1999-01-02", range.getFrom().get().toString()); assertFalse(range.getTo().isPresent()); trp = TemporalRangeParser.builder() .temporalParser(TemporalParser.create(Arrays.asList(DMY_FORMATS))) .create(); range = trp.parse("01/02/1999"); assertFalse(range.hasIssues()); assertEquals("1999-02-01", range.getFrom().get().toString()); assertFalse(range.getTo().isPresent()); range = trp.parse("1999-01-02"); assertFalse(range.hasIssues()); assertEquals("1999-01-02", range.getFrom().get().toString()); assertFalse(range.getTo().isPresent()); }
public EventRange parse(String dateRange) { return parse(null, null, null, dateRange); }
TemporalRangeParser implements Serializable { public EventRange parse(String dateRange) { return parse(null, null, null, dateRange); } }
TemporalRangeParser implements Serializable { public EventRange parse(String dateRange) { return parse(null, null, null, dateRange); } @Builder(buildMethodName = "create") private  TemporalRangeParser(TemporalParser temporalParser); }
TemporalRangeParser implements Serializable { public EventRange parse(String dateRange) { return parse(null, null, null, dateRange); } @Builder(buildMethodName = "create") private  TemporalRangeParser(TemporalParser temporalParser); EventRange parse(String dateRange); EventRange parse(String year, String month, String day, String dateRange); }
TemporalRangeParser implements Serializable { public EventRange parse(String dateRange) { return parse(null, null, null, dateRange); } @Builder(buildMethodName = "create") private  TemporalRangeParser(TemporalParser temporalParser); EventRange parse(String dateRange); EventRange parse(String year, String month, String day, String dateRange);  }