Top Description Fields Constructors Methods
org.h2.util

public Class JSR310Utils

extends Object
Class Inheritance
Static Imports
org.h2.util.DateTimeUtils.NANOS_PER_SECOND, .DateTimeUtils.SECONDS_PER_DAY, .DateTimeUtils.SHIFT_MONTH, .DateTimeUtils.SHIFT_YEAR, .DateTimeUtils.absoluteDayFromDateValue, .DateTimeUtils.dateValue, .DateTimeUtils.dateValueFromAbsoluteDay, .DateTimeUtils.dayFromDateValue, .DateTimeUtils.monthFromDateValue, .DateTimeUtils.yearFromDateValue

This utility class provides access to JSR 310 classes.

Field Summary

Modifier and TypeField and Description
private static final long
private static final long
private static final long
private static final long

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ValueInterval

Returns:

the value
durationToValue
(Duration
the Duration to convert, not null
duration
)

Converts a Duration to a Value.

public static ValueTimestampTimeZone

Returns:

the value
instantToValue
(Instant
the Instant to convert, not null
instant
)

Converts a Instant to a Value.

private static LocalDateTime
localDateTimeFromDateNanos(long dateValue, long timeNanos)

public static ValueTimestamp

Returns:

the value
localDateTimeToValue
(LocalDateTime
the LocalDateTime to convert, not null
localDateTime
)

Converts a LocalDateTime to a Value.

public static ValueDate

Returns:

the value
localDateToValue
(LocalDate
the LocalDate to convert, not null
localDate
)

Converts a LocalDate to a Value.

public static ValueTime

Returns:

the value
localTimeToValue
(LocalTime
the LocalTime to convert, not null
localTime
)

Converts a LocalTime to a Value.

public static ValueTimestampTimeZone

Returns:

the value
offsetDateTimeToValue
(OffsetDateTime
the OffsetDateTime to convert, not null
offsetDateTime
)

Converts a OffsetDateTime to a Value.

public static ValueTimeTimeZone

Returns:

the value
offsetTimeToValue
(OffsetTime
the OffsetTime to convert, not null
offsetTime
)

Converts a OffsetTime to a Value.

public static ValueInterval

Returns:

the value
periodToValue
(Period
the Period to convert, not null
period
)

Converts a Period to a Value.

public static Duration

Returns:

the Duration
valueToDuration
(Value
the value to convert
value
)

Converts a value to a Duration.

public static Instant

Returns:

the Instant
valueToInstant
(Value
the value to convert
value
,
CastDataProvider
the cast information provider
provider
)

Converts a value to a Instant.

public static LocalDate

Returns:

the LocalDate
valueToLocalDate
(Value
the value to convert
value
,
CastDataProvider
the cast information provider
provider
)

Converts a value to a LocalDate.

public static LocalDateTime

Returns:

the LocalDateTime
valueToLocalDateTime
(Value
the value to convert
value
,
CastDataProvider
the cast information provider
provider
)

Converts a value to a LocalDateTime.

public static LocalTime

Returns:

the LocalTime
valueToLocalTime
(Value
the value to convert
value
,
CastDataProvider
the cast information provider
provider
)

Converts a value to a LocalTime.

public static OffsetDateTime

Returns:

the OffsetDateTime
valueToOffsetDateTime
(Value
the value to convert
value
,
CastDataProvider
the cast information provider
provider
)

Converts a value to a OffsetDateTime.

public static OffsetTime

Returns:

the OffsetTime
valueToOffsetTime
(Value
the value to convert
value
,
CastDataProvider
the cast information provider
provider
)

Converts a value to a OffsetTime.

public static Period

Returns:

the Period
valueToPeriod
(Value
the value to convert
value
)

Converts a value to a Period.

public static ZonedDateTime

Returns:

the ZonedDateTime
valueToZonedDateTime
(Value
the value to convert
value
,
CastDataProvider
the cast information provider
provider
)

Converts a value to a ZonedDateTime.

public static ValueTimestampTimeZone

Returns:

the value
zonedDateTimeToValue
(ZonedDateTime
the ZonedDateTime to convert, not null
zonedDateTime
)

Converts a ZonedDateTime to a Value.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

MAX_DATE_VALUEback to summary
private static final long MAX_DATE_VALUE
MAX_INSTANT_SECONDback to summary
private static final long MAX_INSTANT_SECOND
MIN_DATE_VALUEback to summary
private static final long MIN_DATE_VALUE
MIN_INSTANT_SECONDback to summary
private static final long MIN_INSTANT_SECOND

Constructor Detail

JSR310Utilsback to summary
private JSR310Utils()

Method Detail

durationToValueback to summary
public static ValueInterval durationToValue(Duration duration)

Converts a Duration to a Value.

Parameters
duration:Duration

the Duration to convert, not null

Returns:ValueInterval

the value

instantToValueback to summary
public static ValueTimestampTimeZone instantToValue(Instant instant)

Converts a Instant to a Value.

Parameters
instant:Instant

the Instant to convert, not null

Returns:ValueTimestampTimeZone

the value

localDateTimeFromDateNanosback to summary
private static LocalDateTime localDateTimeFromDateNanos(long dateValue, long timeNanos)
localDateTimeToValueback to summary
public static ValueTimestamp localDateTimeToValue(LocalDateTime localDateTime)

Converts a LocalDateTime to a Value.

Parameters
localDateTime:LocalDateTime

the LocalDateTime to convert, not null

Returns:ValueTimestamp

the value

localDateToValueback to summary
public static ValueDate localDateToValue(LocalDate localDate)

Converts a LocalDate to a Value.

Parameters
localDate:LocalDate

the LocalDate to convert, not null

Returns:ValueDate

the value

localTimeToValueback to summary
public static ValueTime localTimeToValue(LocalTime localTime)

Converts a LocalTime to a Value.

Parameters
localTime:LocalTime

the LocalTime to convert, not null

Returns:ValueTime

the value

offsetDateTimeToValueback to summary
public static ValueTimestampTimeZone offsetDateTimeToValue(OffsetDateTime offsetDateTime)

Converts a OffsetDateTime to a Value.

Parameters
offsetDateTime:OffsetDateTime

the OffsetDateTime to convert, not null

Returns:ValueTimestampTimeZone

the value

offsetTimeToValueback to summary
public static ValueTimeTimeZone offsetTimeToValue(OffsetTime offsetTime)

Converts a OffsetTime to a Value.

Parameters
offsetTime:OffsetTime

the OffsetTime to convert, not null

Returns:ValueTimeTimeZone

the value

periodToValueback to summary
public static ValueInterval periodToValue(Period period)

Converts a Period to a Value.

Parameters
period:Period

the Period to convert, not null

Returns:ValueInterval

the value

valueToDurationback to summary
public static Duration valueToDuration(Value value)

Converts a value to a Duration. This method should only be called from Java 8 or later version.

Parameters
value:Value

the value to convert

Returns:Duration

the Duration

valueToInstantback to summary
public static Instant valueToInstant(Value value, CastDataProvider provider)

Converts a value to a Instant. This method should only be called from Java 8 or later version.

Parameters
value:Value

the value to convert

provider:CastDataProvider

the cast information provider

Returns:Instant

the Instant

valueToLocalDateback to summary
public static LocalDate valueToLocalDate(Value value, CastDataProvider provider)

Converts a value to a LocalDate. This method should only be called from Java 8 or later version.

Parameters
value:Value

the value to convert

provider:CastDataProvider

the cast information provider

Returns:LocalDate

the LocalDate

valueToLocalDateTimeback to summary
public static LocalDateTime valueToLocalDateTime(Value value, CastDataProvider provider)

Converts a value to a LocalDateTime. This method should only be called from Java 8 or later version.

Parameters
value:Value

the value to convert

provider:CastDataProvider

the cast information provider

Returns:LocalDateTime

the LocalDateTime

valueToLocalTimeback to summary
public static LocalTime valueToLocalTime(Value value, CastDataProvider provider)

Converts a value to a LocalTime. This method should only be called from Java 8 or later version.

Parameters
value:Value

the value to convert

provider:CastDataProvider

the cast information provider

Returns:LocalTime

the LocalTime

valueToOffsetDateTimeback to summary
public static OffsetDateTime valueToOffsetDateTime(Value value, CastDataProvider provider)

Converts a value to a OffsetDateTime. This method should only be called from Java 8 or later version.

Parameters
value:Value

the value to convert

provider:CastDataProvider

the cast information provider

Returns:OffsetDateTime

the OffsetDateTime

valueToOffsetTimeback to summary
public static OffsetTime valueToOffsetTime(Value value, CastDataProvider provider)

Converts a value to a OffsetTime. This method should only be called from Java 8 or later version.

Parameters
value:Value

the value to convert

provider:CastDataProvider

the cast information provider

Returns:OffsetTime

the OffsetTime

valueToPeriodback to summary
public static Period valueToPeriod(Value value)

Converts a value to a Period. This method should only be called from Java 8 or later version.

Parameters
value:Value

the value to convert

Returns:Period

the Period

valueToZonedDateTimeback to summary
public static ZonedDateTime valueToZonedDateTime(Value value, CastDataProvider provider)

Converts a value to a ZonedDateTime. This method should only be called from Java 8 or later version.

Parameters
value:Value

the value to convert

provider:CastDataProvider

the cast information provider

Returns:ZonedDateTime

the ZonedDateTime

zonedDateTimeToValueback to summary
public static ValueTimestampTimeZone zonedDateTimeToValue(ZonedDateTime zonedDateTime)

Converts a ZonedDateTime to a Value.

Parameters
zonedDateTime:ZonedDateTime

the ZonedDateTime to convert, not null

Returns:ValueTimestampTimeZone

the value