add toJSON method

Signed-off-by: brucefengnju <brucechenofnju@gmail.com>
add toJSON method

Signed-off-by: brucefengnju <brucechenofnju@gmail.com>