encode

open override fun encode(json: JSONObject): JSONObject

Can throw an exception if encoding fails.