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