@Override public String toString() { if (timestampEmpty) { populateTimestamp(); } String timestampString = timestamp.toString(); if (timestampString.length() > 19) { if (timestampString.length() == 21) { if (timestampString.substring(19).compareTo(".0") == 0) { return threadLocalDateFormat.get().format(timestamp); } } return threadLocalDateFormat.get().format(timestamp) + timestampString.substring(19); } return threadLocalDateFormat.get().format(timestamp); }
public Timestamp getTimestamp() { if (timestampEmpty) { populateTimestamp(); } return timestamp; }