@Test(expected = StepInternalException.class) public void testTooManyParts() { PartialDate.parseDate("1-1-1-1-1"); }
public static PartialDate parseDate(final String date) { if (date == null) { return new PartialDate(null, PrecisionType.NONE); } final String trimmedDate = date.trim(); if (isEmpty(trimmedDate)) { return new PartialDate(null, PrecisionType.NONE); } final boolean negativeDate = date.charAt(0) == '-'; final String parseableDate = negativeDate ? trimmedDate.substring(1) : trimmedDate; return getPartialDateFromArray(split(parseableDate.trim(), DATE_DELIMITER), negativeDate); }
PartialDate { public static PartialDate parseDate(final String date) { if (date == null) { return new PartialDate(null, PrecisionType.NONE); } final String trimmedDate = date.trim(); if (isEmpty(trimmedDate)) { return new PartialDate(null, PrecisionType.NONE); } final boolean negativeDate = date.charAt(0) == '-'; final String parseableDate = negativeDate ? trimmedDate.substring(1) : trimmedDate; return getPartialDateFromArray(split(parseableDate.trim(), DATE_DELIMITER), negativeDate); } }
PartialDate { public static PartialDate parseDate(final String date) { if (date == null) { return new PartialDate(null, PrecisionType.NONE); } final String trimmedDate = date.trim(); if (isEmpty(trimmedDate)) { return new PartialDate(null, PrecisionType.NONE); } final boolean negativeDate = date.charAt(0) == '-'; final String parseableDate = negativeDate ? trimmedDate.substring(1) : trimmedDate; return getPartialDateFromArray(split(parseableDate.trim(), DATE_DELIMITER), negativeDate); } PartialDate(final LocalDateTime ldt, final PrecisionType precision); }
PartialDate { public static PartialDate parseDate(final String date) { if (date == null) { return new PartialDate(null, PrecisionType.NONE); } final String trimmedDate = date.trim(); if (isEmpty(trimmedDate)) { return new PartialDate(null, PrecisionType.NONE); } final boolean negativeDate = date.charAt(0) == '-'; final String parseableDate = negativeDate ? trimmedDate.substring(1) : trimmedDate; return getPartialDateFromArray(split(parseableDate.trim(), DATE_DELIMITER), negativeDate); } PartialDate(final LocalDateTime ldt, final PrecisionType precision); static PartialDate parseDate(final String date); LocalDateTime getDate(); PrecisionType getPrecision(); }
PartialDate { public static PartialDate parseDate(final String date) { if (date == null) { return new PartialDate(null, PrecisionType.NONE); } final String trimmedDate = date.trim(); if (isEmpty(trimmedDate)) { return new PartialDate(null, PrecisionType.NONE); } final boolean negativeDate = date.charAt(0) == '-'; final String parseableDate = negativeDate ? trimmedDate.substring(1) : trimmedDate; return getPartialDateFromArray(split(parseableDate.trim(), DATE_DELIMITER), negativeDate); } PartialDate(final LocalDateTime ldt, final PrecisionType precision); static PartialDate parseDate(final String date); LocalDateTime getDate(); PrecisionType getPrecision();  }