1. قم بتحويل الكائن إلى سلسلة JSON ، وأرجع القيمة إلى سلسلة JSON
السلسلة الثابتة العامة tojson (قيمة الكائن) {try {return mapper.writevalueasString (value) ؛} catch (استثناء e) {e.printstacktrace () ؛} return null ؛} 2. تحويل سلسلة JSON إلى كائن الكيان ، قيمة الإرجاع ككائن كيان
static static <T> toBject (سلسلة json ، الفئة <T> valueType) {assert.hastext (json) ؛ assert.notnull (valuetype) ؛ حاول {simpledateformat = new spistorformat ("yyyy-mm-dd hh: mm: ss") mapper.readvalue (json ، valuetype) ؛} catch (استثناء e) {E.PrintStackTrace () ؛} return null ؛