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

com.twitter.finatra.json.internal.serde.DurationMillisSerializer.scala Maven / Gradle / Ivy

There is a newer version: 2.1.6
Show newest version
package com.twitter.finatra.json.internal.serde

import com.fasterxml.jackson.core.JsonGenerator
import com.fasterxml.jackson.databind.SerializerProvider
import com.fasterxml.jackson.databind.ser.std.StdSerializer
import org.joda.time.Duration

object DurationMillisSerializer extends StdSerializer[Duration](classOf[Duration]) {

  override def serialize(value: Duration, jgen: JsonGenerator, provider: SerializerProvider) {
    jgen.writeNumber(value.getMillis)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy