zero-knowledge/src/main/java/com/hedera/hashgraph/zeroknowledge/marshaller/ZeroKnowledgeVpMarshaller.java
/**
     * From json string format to concrete document converter.
     *
     * @param jsonDocument The document represented as a json object.
     * @return The internal representation of a verifiable presentation.
     */
From json string format to concrete document converter.
@param jsonDocument The document represented as a json object.
@return The internal representation of a verifiable presentation.
From json string format to concrete document converter . @param jsonDocument The document represented as a json object . @return The internal representation of a verifiable presentation .
protected T fromJsonToDocument(JsonObject jsonDocument) {
        T decodedDocument = initializeNewBlankDocument();
        String docId = jsonDocument.get(HcsVpDocumentJsonProperties.ID).getAsString();
        decodedDocument.setId(docId);
        List<String> docTypes = getJsonElementAsList(jsonDocument.get(HcsVpDocumentJsonProperties.TYPE));
        decodedDocument.setType(docTypes);
        String holder = jsonDocument.get(HcsVpDocumentJsonProperties.HOLDER).getAsString();
        decodedDocument.setHolder(holder);
        String issuanceDate = jsonDocument.get(HcsVpDocumentJsonProperties.ISSUANCE_DATE).getAsString();
        decodedDocument.setIssuanceDate(Instant.parse(issuanceDate));
        List<String> docContext = getJsonElementAsList(jsonDocument.get(HcsVpDocumentJsonProperties.CONTEXT));
        decodedDocument.setContext(docContext);
        return decodedDocument;
    }
protected T fromJsonToDocument ( JsonObject jsonDocument ) { T decodedDocument = initializeNewBlankDocument ( ) ; String docId = jsonDocument . get ( HcsVpDocumentJsonProperties . ID ) . getAsString ( ) ; decodedDocument . setId ( docId ) ; List < String > docTypes = getJsonElementAsList ( jsonDocument . get ( HcsVpDocumentJsonProperties . TYPE ) ) ; decodedDocument . setType ( docTypes ) ; String holder = jsonDocument . get ( HcsVpDocumentJsonProperties . HOLDER ) . getAsString ( ) ; decodedDocument . setHolder ( holder ) ; String issuanceDate = jsonDocument . get ( HcsVpDocumentJsonProperties . ISSUANCE_DATE ) . getAsString ( ) ; decodedDocument . setIssuanceDate ( Instant . parse ( issuanceDate ) ) ; List < String > docContext = getJsonElementAsList ( jsonDocument . get ( HcsVpDocumentJsonProperties . CONTEXT ) ) ; decodedDocument . setContext ( docContext ) ; return decodedDocument ; }
From json string format to concrete document converter.
From json string format to concrete document converter .