Class DurationTypeAdapter
java.lang.Object
com.google.gson.TypeAdapter<Duration>
eu.cloudnetservice.driver.impl.document.gson.DurationTypeAdapter
A type adapter that can serialize and deserialize durations into/from json.
- Since:
- 4.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDurationTypeAdapter(@NonNull com.google.gson.Gson gsonInstance) Constructs a new instance of the duration type adapter. -
Method Summary
Methods inherited from class com.google.gson.TypeAdapter
fromJson, fromJson, fromJsonTree, nullSafe, toJson, toJson, toJsonTree
-
Field Details
-
stringTypeAdapter
-
-
Constructor Details
-
DurationTypeAdapter
Constructs a new instance of the duration type adapter.- Parameters:
gsonInstance- the gson instance this type adapter instance got bound to.- Throws:
NullPointerException- if the given gson instance is null.
-
-
Method Details
-
write
public void write(@NonNull @NonNull com.google.gson.stream.JsonWriter out, @Nullable @Nullable Duration value) throws IOException - Specified by:
writein classcom.google.gson.TypeAdapter<Duration>- Throws:
IOException
-
read
@Nullable public @Nullable Duration read(@NonNull @NonNull com.google.gson.stream.JsonReader in) throws IOException - Specified by:
readin classcom.google.gson.TypeAdapter<Duration>- Throws:
IOException
-