All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.netflix.spinnaker.jooq.LocalDateTimeToInstantConverter.kt Maven / Gradle / Ivy

There is a newer version: 1.4.1
Show newest version
package com.netflix.spinnaker.jooq

import org.jooq.impl.AbstractConverter
import java.time.Instant
import java.time.LocalDateTime
import java.time.ZoneOffset.UTC

class LocalDateTimeToInstantConverter : AbstractConverter(
  LocalDateTime::class.java,
  Instant::class.java
) {
  override fun from(databaseObject: LocalDateTime?): Instant? =
    databaseObject?.toInstant(UTC)

  override fun to(userObject: Instant?): LocalDateTime? =
    userObject?.atZone(UTC)?.toLocalDateTime()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy