Class LocalDateAdapter
java.lang.Object
net.thauvin.erik.frankfurter.models.LocalDateAdapter
- All Implemented Interfaces:
JsonDeserializer<LocalDate>,JsonSerializer<LocalDate>
public class LocalDateAdapter
extends Object
implements JsonSerializer<LocalDate>, JsonDeserializer<LocalDate>
Custom adapter for serializing and deserializing
LocalDate objects using Gson.- Since:
- 0.9.0
- Author:
- Erik C. Thauvin
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) serialize(LocalDate localDate, Type type, JsonSerializationContext jsonSerializationContext)
-
Constructor Details
-
LocalDateAdapter
public LocalDateAdapter()
-
-
Method Details
-
deserialize
public LocalDate deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException - Specified by:
deserializein interfaceJsonDeserializer<LocalDate>- Throws:
JsonParseException
-
serialize
public JsonElement serialize(LocalDate localDate, Type type, JsonSerializationContext jsonSerializationContext) - Specified by:
serializein interfaceJsonSerializer<LocalDate>
-