Package org.h2.util
Class JSR310Utils
java.lang.Object
org.h2.util.JSR310Utils
This utility class provides access to JSR 310 classes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
private static final long
private static final long
private static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ValueInterval
durationToValue
(Duration duration) Converts a Duration to a Value.static ValueTimestampTimeZone
instantToValue
(Instant instant) Converts a Instant to a Value.private static LocalDateTime
localDateTimeFromDateNanos
(long dateValue, long timeNanos) static ValueTimestamp
localDateTimeToValue
(LocalDateTime localDateTime) Converts a LocalDateTime to a Value.static ValueDate
localDateToValue
(LocalDate localDate) Converts a LocalDate to a Value.static ValueTime
localTimeToValue
(LocalTime localTime) Converts a LocalTime to a Value.static ValueTimestampTimeZone
offsetDateTimeToValue
(OffsetDateTime offsetDateTime) Converts a OffsetDateTime to a Value.static ValueTimeTimeZone
offsetTimeToValue
(OffsetTime offsetTime) Converts a OffsetTime to a Value.static ValueInterval
periodToValue
(Period period) Converts a Period to a Value.static Duration
valueToDuration
(Value value) Converts a value to a Duration.static Instant
valueToInstant
(Value value, CastDataProvider provider) Converts a value to a Instant.static LocalDate
valueToLocalDate
(Value value, CastDataProvider provider) Converts a value to a LocalDate.static LocalDateTime
valueToLocalDateTime
(Value value, CastDataProvider provider) Converts a value to a LocalDateTime.static LocalTime
valueToLocalTime
(Value value, CastDataProvider provider) Converts a value to a LocalTime.static OffsetDateTime
valueToOffsetDateTime
(Value value, CastDataProvider provider) Converts a value to a OffsetDateTime.static OffsetTime
valueToOffsetTime
(Value value, CastDataProvider provider) Converts a value to a OffsetTime.static Period
valueToPeriod
(Value value) Converts a value to a Period.static ZonedDateTime
valueToZonedDateTime
(Value value, CastDataProvider provider) Converts a value to a ZonedDateTime.static ValueTimestampTimeZone
zonedDateTimeToValue
(ZonedDateTime zonedDateTime) Converts a ZonedDateTime to a Value.
-
Field Details
-
MIN_DATE_VALUE
private static final long MIN_DATE_VALUE- See Also:
-
MAX_DATE_VALUE
private static final long MAX_DATE_VALUE- See Also:
-
MIN_INSTANT_SECOND
private static final long MIN_INSTANT_SECOND- See Also:
-
MAX_INSTANT_SECOND
private static final long MAX_INSTANT_SECOND- See Also:
-
-
Constructor Details
-
JSR310Utils
private JSR310Utils()
-
-
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
-
localDateTimeFromDateNanos
-
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
-