You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def main(args: Array[String]): Unit = {
val e = new JsonPrimitive("zz")
println(e)
println(e.getAsString)
println(new JsonPrimitive(e.toString))
println(new JsonPrimitive(new JsonPrimitive(e.toString).toString))
}
result :
"zz"
zz
"\"zz\""
"\"\\\"zz\\\"\""
I think the com.google.gson.streamJsonWrite.string(value:String) is fine as a child element, but it's worth pondering when we use toString() for an independent JsonPrimitive object.