contract/lib/BeanState.js
/**
     * Deserialize object into specific object class
     * Typically used after getState() ledger API
     * @param {object} dataToDeserialize Data to deserialize into JSON object.
     * @param {object} objClass Object type that can be serialized to the system.
     * @return {json} JSON with the data to store.
     */
Deserialize object into specific object class
Typically used after getState() ledger API
@param {object} dataToDeserialize Data to deserialize into JSON object.
@param {object} objClass Object type that can be serialized to the system.
@return {json} JSON with the data to store.
Deserialize object into specific object class Typically used after getState () ledger API @param { object } dataToDeserialize Data to deserialize into JSON object . @param { object } objClass Object type that can be serialized to the system . @return { json } JSON with the data to store .
static deserializeClass(dataToDeserialize, objClass) {
        logWrite(`[deserializeClass] objClass = ${objClass}`);
        logWrite(`[deserializeClass] dataToDeserialize = ${dataToDeserialize}`);
        if (dataToDeserialize == null || dataToDeserialize == undefined) { return; }
        let json = JSON.parse(dataToDeserialize.toString());
        let object = new (objClass)(json);
        return object;
    }
static deserializeClass ( dataToDeserialize , objClass ) { logWrite ( ` ${ objClass } ` ) ; logWrite ( ` ${ dataToDeserialize } ` ) ; if ( dataToDeserialize == null || dataToDeserialize == undefined ) { return ; } let json = JSON . parse ( dataToDeserialize . toString ( ) ) ; let object = new ( objClass ) ( json ) ; return object ; }
Deserialize object into specific object class
 Typically used after getState() ledger API
 @param {object} dataToDeserialize Data to deserialize into JSON object.
Deserialize object into specific object class Typically used after getState () ledger API @param { object } dataToDeserialize Data to deserialize into JSON object .