Package net.bramp.ffmpeg.gson
Class NamedBitsetAdapter<T>
java.lang.Object
com.google.gson.TypeAdapter<T>
net.bramp.ffmpeg.gson.NamedBitsetAdapter<T>
Converts a json object which represents a set of booleans. For example:
public class Set {
public boolean a = true;
public boolean b = false;
public int c = 1;
public int d = 0;
}
is turned into:
{ "a": true, "b": false, "c": true, "d": false }
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionread
(com.google.gson.stream.JsonReader reader) protected com.google.common.base.Optional
<Boolean> readBoolean
(com.google.gson.stream.JsonReader reader) protected void
void
Methods inherited from class com.google.gson.TypeAdapter
fromJson, fromJson, fromJsonTree, nullSafe, toJson, toJson, toJsonTree
-
Constructor Details
-
NamedBitsetAdapter
-
-
Method Details
-
readBoolean
protected com.google.common.base.Optional<Boolean> readBoolean(com.google.gson.stream.JsonReader reader) throws IOException - Throws:
IOException
-
setField
- Throws:
IllegalAccessException
-
read
- Specified by:
read
in classcom.google.gson.TypeAdapter<T>
- Throws:
IOException
-
write
- Specified by:
write
in classcom.google.gson.TypeAdapter<T>
- Throws:
IOException
-