Package org.h2.util
Class JSR310Utils
java.lang.Object
org.h2.util.JSR310Utils
This utility class provides access to JSR 310 classes.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ValueIntervaldurationToValue(Duration duration) Converts a Duration to a Value.static ValueTimestampTimeZoneinstantToValue(Instant instant) Converts a Instant to a Value.static ValueTimestamplocalDateTimeToValue(LocalDateTime localDateTime) Converts a LocalDateTime to a Value.static ValueDatelocalDateToValue(LocalDate localDate) Converts a LocalDate to a Value.static ValueTimelocalTimeToValue(LocalTime localTime) Converts a LocalTime to a Value.static ValueTimestampTimeZoneoffsetDateTimeToValue(OffsetDateTime offsetDateTime) Converts a OffsetDateTime to a Value.static ValueTimeTimeZoneoffsetTimeToValue(OffsetTime offsetTime) Converts a OffsetTime to a Value.static ValueIntervalperiodToValue(Period period) Converts a Period to a Value.static DurationvalueToDuration(Value value) Converts a value to a Duration.static InstantvalueToInstant(Value value, CastDataProvider provider) Converts a value to a Instant.static LocalDatevalueToLocalDate(Value value, CastDataProvider provider) Converts a value to a LocalDate.static LocalDateTimevalueToLocalDateTime(Value value, CastDataProvider provider) Converts a value to a LocalDateTime.static LocalTimevalueToLocalTime(Value value, CastDataProvider provider) Converts a value to a LocalTime.static OffsetDateTimevalueToOffsetDateTime(Value value, CastDataProvider provider) Converts a value to a OffsetDateTime.static OffsetTimevalueToOffsetTime(Value value, CastDataProvider provider) Converts a value to a OffsetTime.static PeriodvalueToPeriod(Value value) Converts a value to a Period.static ZonedDateTimevalueToZonedDateTime(Value value, CastDataProvider provider) Converts a value to a ZonedDateTime.static ValueTimestampTimeZonezonedDateTimeToValue(ZonedDateTime zonedDateTime) Converts a ZonedDateTime to a Value.
-
Method Details
-
valueToLocalDate
Converts a value to a LocalDate. This method should only be called from Java 8 or later version.- Parameters:
value- the value to convertprovider- the cast information provider- Returns:
- the LocalDate
-
valueToLocalTime
Converts a value to a LocalTime. This method should only be called from Java 8 or later version.- Parameters:
value- the value to convertprovider- the cast information provider- Returns:
- the LocalTime
-
valueToLocalDateTime
Converts a value to a LocalDateTime. This method should only be called from Java 8 or later version.- Parameters:
value- the value to convertprovider- the cast information provider- Returns:
- the LocalDateTime
-
valueToInstant
Converts a value to a Instant. This method should only be called from Java 8 or later version.- Parameters:
value- the value to convertprovider- the cast information provider- Returns:
- the Instant
-
valueToOffsetDateTime
Converts a value to a OffsetDateTime. This method should only be called from Java 8 or later version.- Parameters:
value- the value to convertprovider- the cast information provider- Returns:
- the OffsetDateTime
-
valueToZonedDateTime
Converts a value to a ZonedDateTime. This method should only be called from Java 8 or later version.- Parameters:
value- the value to convertprovider- the cast information provider- Returns:
- the ZonedDateTime
-
valueToOffsetTime
Converts a value to a OffsetTime. This method should only be called from Java 8 or later version.- Parameters:
value- the value to convertprovider- the cast information provider- Returns:
- the OffsetTime
-
valueToPeriod
Converts a value to a Period. This method should only be called from Java 8 or later version.- Parameters:
value- the value to convert- Returns:
- the Period
-
valueToDuration
Converts a value to a Duration. This method should only be called from Java 8 or later version.- Parameters:
value- the value to convert- Returns:
- the Duration
-
localDateToValue
Converts a LocalDate to a Value.- Parameters:
localDate- the LocalDate to convert, notnull- Returns:
- the value
-
localTimeToValue
Converts a LocalTime to a Value.- Parameters:
localTime- the LocalTime to convert, notnull- Returns:
- the value
-
localDateTimeToValue
Converts a LocalDateTime to a Value.- Parameters:
localDateTime- the LocalDateTime to convert, notnull- Returns:
- the value
-
instantToValue
Converts a Instant to a Value.- Parameters:
instant- the Instant to convert, notnull- Returns:
- the value
-
offsetDateTimeToValue
Converts a OffsetDateTime to a Value.- Parameters:
offsetDateTime- the OffsetDateTime to convert, notnull- Returns:
- the value
-
zonedDateTimeToValue
Converts a ZonedDateTime to a Value.- Parameters:
zonedDateTime- the ZonedDateTime to convert, notnull- Returns:
- the value
-
offsetTimeToValue
Converts a OffsetTime to a Value.- Parameters:
offsetTime- the OffsetTime to convert, notnull- Returns:
- the value
-
periodToValue
Converts a Period to a Value.- Parameters:
period- the Period to convert, notnull- Returns:
- the value
-
durationToValue
Converts a Duration to a Value.- Parameters:
duration- the Duration to convert, notnull- Returns:
- the value
-