public class LocalDateTimeFormatter extends AbstractFormatter<java.time.LocalDateTime>
Constructor and Description |
---|
LocalDateTimeFormatter() |
LocalDateTimeFormatter(java.lang.String pattern) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
format(java.time.LocalDateTime time)
Formats an instance into its literal representation.
|
java.lang.String |
getPattern() |
java.time.LocalDateTime |
parse(java.lang.String str)
Parses a literal representation into an instance of type
T . |
parseError, parseError, parseHexInt, parseHexInt
public LocalDateTimeFormatter()
public LocalDateTimeFormatter(@Nullable java.lang.String pattern)
@Nonnull public java.lang.String getPattern()
@Nullable public java.lang.String format(@Nullable java.time.LocalDateTime time)
Formatter
Formats an instance into its literal representation.
The resulting String
may be set as an argument to Formatter.parse(java.lang.String)
resulting in a similar instance as the input.
time
- the instance to be formattedString
representing the instance's state.@Nullable public java.time.LocalDateTime parse(@Nullable java.lang.String str) throws ParseException
Formatter
Parses a literal representation into an instance of type T
.
The resulting instance T
may be set as an argument to Formatter.format(T)
resulting in an equal String
as the input.
str
- the String
to be parsedT
whose state is initialized given the
parameters of the input String
.ParseException
- if the String
cannot be parsed.