TimestampFormatter@IgnoreJRERequirement public final class PreciseTimestampFormatter extends java.lang.Object implements TimestampFormatter
DateTimeFormatter with nanosecond precision. The last formatted timestamp
will be cached, if the formatter does neither output nanoseconds nor microseconds.| Constructor | Description |
|---|---|
PreciseTimestampFormatter(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 PreciseTimestampFormatter(java.lang.String pattern,
java.util.Locale locale)
pattern - Format pattern that is compatible with DateTimeFormatterlocale - Locale for formattingpublic boolean isValid(java.lang.String timestamp)
TimestampFormatterisValid in interface TimestampFormattertimestamp - Formatted timestamptrue if the given timestamp is compatible with the pattern of this formatter, false if
notpublic java.lang.String format(Timestamp timestamp)
TimestampFormatterformat in interface TimestampFormattertimestamp - Timestamp to formatCopyright © 2020. All rights reserved.