public class DurationAdapter
extends com.solidfire.gson.TypeAdapter<org.joda.time.Duration>
Constructor and Description |
---|
DurationAdapter() |
Modifier and Type | Method and Description |
---|---|
org.joda.time.Duration |
read(com.solidfire.gson.stream.JsonReader reader)
Reads a Duration object.
|
static java.lang.Class<org.joda.time.Duration> |
serializingClass()
Gets the Class that this adapter serializes.
|
void |
write(com.solidfire.gson.stream.JsonWriter writer,
org.joda.time.Duration value)
Writes a Duration object.
|
public static java.lang.Class<org.joda.time.Duration> serializingClass()
public org.joda.time.Duration read(com.solidfire.gson.stream.JsonReader reader) throws java.io.IOException
read
in class com.solidfire.gson.TypeAdapter<org.joda.time.Duration>
reader
- the JSON reader to read from.java.io.IOException
- if the Duration can not be parsed.public void write(com.solidfire.gson.stream.JsonWriter writer, org.joda.time.Duration value) throws java.io.IOException
write
in class com.solidfire.gson.TypeAdapter<org.joda.time.Duration>
writer
- the JSON writer to write to.value
- the Duration object to write.java.io.IOException