/*
Copyright (c) [2023] [squallzhao]
fountain is licensed under APACHE LICENSE, VERSION 2.0.
You can use this software according to the terms and conditions of the APACHE LICENSE, VERSION 2.0.
You may obtain a copy of APACHE LICENSE, VERSION 2.0 at: https://www.apache.org/licenses/LICENSE-2.0
*/
package microservice.web.codecs
import encoding.json.*
public class ResponseJsonObject <: Object{
var instMap = JsonObject()
public func put(key: String, s: String): ResponseJsonObject{
instMap.put(key, JsonString(s))
return this
}
public func put(key: String, i: Int64): ResponseJsonObject{
instMap.put(key, JsonInt(i))
return this
}
public func put(key:String, b: Bool): ResponseJsonObject{
instMap.put(key, JsonBool(b))
return this
}
public func put(key:String, j: ResponseJsonObject): ResponseJsonObject{
instMap.put(key, j.getJsonObject())
return this
}
public func toJsonString():String{
return instMap.toJsonString()
}
public func getJsonObject(): JsonObject{
return instMap
}
}