Package server
Class Gson_InstantTypeAdapter
java.lang.Object
com.google.gson.TypeAdapter<Instant>
server.Gson_InstantTypeAdapter
Source - https://stackoverflow.com/a/75502641
Posted by Basil Bourque, modified by community. See post 'Timeline' for change history
Retrieved 2026-02-03, License - CC BY-SA 4.0
Doc comments provided by Henning.
TypeAdapter for the Instant data type since it cant be natively serialized into json by Gson.
Posted by Basil Bourque, modified by community. See post 'Timeline' for change history
Retrieved 2026-02-03, License - CC BY-SA 4.0
Doc comments provided by Henning.
TypeAdapter for the Instant data type since it cant be natively serialized into json by Gson.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.google.gson.TypeAdapter
fromJson, fromJson, fromJsonTree, nullSafe, toJson, toJson, toJsonTree
-
Constructor Details
-
Gson_InstantTypeAdapter
public Gson_InstantTypeAdapter()Constructor added to prevent javadoc warning
-
-
Method Details
-
write
Serialization step. Turns the Instant into a String with ISO 8601 format- Specified by:
writein classcom.google.gson.TypeAdapter<Instant>- Throws:
IOException
-
read
Deserialization step. Parses the String back into an Instant object.- Specified by:
readin classcom.google.gson.TypeAdapter<Instant>- Throws:
IOException
-