public final class LegacyTimestampFormatter extends Object implements TimestampFormatter
SimpleDateFormat with millisecond precision. The last formatted timestamp
will be cached.| Constructor and Description |
|---|
LegacyTimestampFormatter(String pattern,
Locale locale) |
| Modifier and Type | Method and Description |
|---|---|
String |
format(Timestamp timestamp)
Formats a timestamp.
|
boolean |
isValid(String timestamp)
Checks whether a formatted timestamp is compatible with the pattern of this formatter.
|
public LegacyTimestampFormatter(String pattern, Locale locale)
pattern - Format pattern that is compatible with SimpleDateFormatlocale - Locale for formattingpublic boolean isValid(String timestamp)
TimestampFormatterisValid in interface TimestampFormattertimestamp - Formatted timestamptrue if the given timestamp is compatible with the pattern of this formatter, false if
notpublic String format(Timestamp timestamp)
TimestampFormatterformat in interface TimestampFormattertimestamp - Timestamp to formatCopyright © 2020. All rights reserved.