java.lang.Object
io.github.mmm.base.temporal.TemporalParser
- All Implemented Interfaces:
FromStringParser<Temporal>
Parser that can detect
Strings representing a Temporal value via parse(String) but returns
null if not a Temporal instead of throwing an exception.- Since:
- 1.0.0
- See Also:
-
Method Summary
-
Method Details
-
parse
Description copied from interface:FromStringParserParses the givenStringto the type handled by this parser but efficiently returnsnullif the syntax does not match. This allows to detect the format without wasting much performance.- Specified by:
parsein interfaceFromStringParser<Temporal>- Parameters:
value- thedefault string representationof a (potential)Temporalvalue. This can beInstant,LocalDate,LocalTime,LocalDateTime,OffsetTime,OffsetDateTime,ZonedDateTime, orYearMonth. Please note thatChronoLocalDatesuch asHijrahDate,JapaneseDate,MinguoDate, orThaiBuddhistDateare not supported. AlsoYearis not supported as it can easily be confused with a regular integer and can also be detected easily with just two lines of code.- Returns:
- the given
valueparsed asTemporalornullif not any of the supportedTemporaltypes.
-
get
- Returns:
- the singleton instance of this
FromStringParserforTemporal.
-