typeTokenremoves generic type parameter wildcards. This means thattypeToken<List<Something>>will now returnList<Something>instead ofList<? extends Something>.- Added the
byNullable*functions to delegate to nullable values inside aJsonObjectorJsonArray(thanks to @eygraber Eliezer Graber). - Added the possibility to define a default value to the delegate
by*methods (thanks to @eygraber Eliezer Graber). - Added the
addPropertyandaddPropertyIfNotNullmethods toJsonObject(thanks to @ColinHebert Colin Hebert). - Added the ability to add a
JsonSerializerandJsonDeserializerwithregisterTypeAdapter(thanks to @ColinHebert Colin Hebert). - Gson
2.8.0, see changelog. - Kotlin
1.0.6 - Gradle
3.3
typeTokenis more permissive with generic parameters. It tries to infer generic wildcards.- Kotlin
1.0.3 - Gradle
2.14.1. - Spek
1.0.25.
- In a
JsonSerializer, usingit.context.serializenow serializes according to the object real type (at runtime), which is consistent withGson.toJson. Serializing according to the compile time type is possible withit.context.typedSerialize, which is consistent withGson.typedToJson. - Gson
2.7, see changelog. - Kotlin
1.0.2-1
jsonArrayandjsonObjectfunctions are now usable withIterableandSequence.- Gradle
2.13.
- Kotlin
1.0.2. - Spek
1.0.9.
- Kotlin
1.0.1. - Gson
2.6.2. - Spek
1.0.0. - Added
readandwritetoregisterTypeAdapterandregisterTypeHierarchyAdapter. - Added
registerNullableTypeAdapterabdregisterNullableTypeHierarchyAdapter. - Renamed
typeTokentogsonTypeTokenandregistrationTypeTokentotypeToken. That means thattypeToken<List<*>>will now return aClass. If still want aParametrizedTypecorresponding to java'sList<? extends Object>, you should usegsonTypeToken.
- Kotlin
1.0.0. - gson
2.6.1.
- Correcting #11:
typeTokenis back to its classic gson semantic. registrationTypeTokenhas the semantic of the previoustypeToken.
- Kotlin
1.0.0-beta-1036. - Gson
2.5. - Introducing
typedToJson. typeTokennow returns aClassinstead of aParameterizedTypewhen for non specialized generic types (such asList<*>*).- New syntax for
registerTypeAdapterandregisterTypeHierarchyAdapterfor declaring type adapters (serializers and deserializers).