Class JodaLocalDateSerializer
- java.lang.Object
-
- com.esotericsoftware.kryo.Serializer<org.joda.time.LocalDate>
-
- de.javakaffee.kryoserializers.jodatime.JodaLocalDateSerializer
-
public class JodaLocalDateSerializer extends com.esotericsoftware.kryo.Serializer<org.joda.time.LocalDate>A Kryo serializer for jodaLocalDate. The LocalDate object is read or written as year, month-of-year and day-of-month packed into one integer, and chronology as a separate attribute. No time zone is involved. If the chronology isISOChronologythe attribute is serialized as an empty string, thusISOChronologyis considered to be default. Note that internally the LocalDate object makes use of an iLocalMillis value, but that field is not accessible for reading here because the getLocalMillis() method is protected. There could conceivably be cases where a user has created a derived version of LocalDate, and is using the iLocalMillis value in some way that this serialization/deserialization will break. (Alternative implementation: access the field using Java reflection?)The following chronologies are supported:
ISOChronologyCopticChronologyEthiopicChronologyGregorianChronologyJulianChronologyIslamicChronologyBuddhistChronologyGJChronology
- Author:
- Rennie Petersen
-
-
Constructor Summary
Constructors Constructor Description JodaLocalDateSerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.joda.time.LocalDateread(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input, Class<? extends org.joda.time.LocalDate> type)voidwrite(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output, org.joda.time.LocalDate localDate)
-
-
-
Method Detail
-
read
public org.joda.time.LocalDate read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input, Class<? extends org.joda.time.LocalDate> type)- Specified by:
readin classcom.esotericsoftware.kryo.Serializer<org.joda.time.LocalDate>
-
write
public void write(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output, org.joda.time.LocalDate localDate)- Specified by:
writein classcom.esotericsoftware.kryo.Serializer<org.joda.time.LocalDate>
-
-