@Test public void refuseInvalidFormattedTimestamp() { PreciseTimestampFormatter formatter = new PreciseTimestampFormatter("HH:mm:ss.SSSSSSSSS", Locale.US); assertThat(formatter.isValid("1985-06-03")).isFalse(); }
@Override public boolean isValid(final String timestamp) { try { formatter.parse(timestamp); return true; } catch (DateTimeParseException ex) { return false; } }
PreciseTimestampFormatter implements TimestampFormatter { @Override public boolean isValid(final String timestamp) { try { formatter.parse(timestamp); return true; } catch (DateTimeParseException ex) { return false; } } }
PreciseTimestampFormatter implements TimestampFormatter { @Override public boolean isValid(final String timestamp) { try { formatter.parse(timestamp); return true; } catch (DateTimeParseException ex) { return false; } } PreciseTimestampFormatter(final String pattern, final Locale locale); }
PreciseTimestampFormatter implements TimestampFormatter { @Override public boolean isValid(final String timestamp) { try { formatter.parse(timestamp); return true; } catch (DateTimeParseException ex) { return false; } } PreciseTimestampFormatter(final String pattern, final Locale locale); @Override boolean isValid(final String timestamp); @Override String format(final Timestamp timestamp); }
PreciseTimestampFormatter implements TimestampFormatter { @Override public boolean isValid(final String timestamp) { try { formatter.parse(timestamp); return true; } catch (DateTimeParseException ex) { return false; } } PreciseTimestampFormatter(final String pattern, final Locale locale); @Override boolean isValid(final String timestamp); @Override String format(final Timestamp timestamp);  }