more tests with gson (de)serialiser

This commit is contained in:
minjaesong
2019-02-23 17:40:13 +09:00
parent 73dfab206e
commit 8cc9b98a12
4 changed files with 38 additions and 54 deletions

View File

@@ -1,6 +1,5 @@
package net.torvald.terrarum
import com.google.gson.Gson
import com.google.gson.JsonObject
import com.google.gson.JsonPrimitive
@@ -115,12 +114,4 @@ open class KVHashMap : GsonSerialisable {
TODO()
}
override fun write(targetGson: JsonObject) {
hashMap.forEach { t, u ->
if (u is JsonPrimitive)
targetGson.add(t, u)
else
targetGson.add(t, Gson().toJsonTree(u))
}
}
}