examples/appnet-api-server/src/main/java/com/hedera/hashgraph/identity/hcs/example/appnet/vc/DrivingLicense.java
/**
     * Note: this is a manual implementation of ordered JSON items for this simple non-nested schema.
     * In a real-world application it is recommended to use a JSON-LD compatible library to handle normalization.
     * However at this point the only available one in Java support JSON-LD version 1.0, but 1.1 is required by W3C
     * Verifiable Credentials.
     *
     * @return A normalized JSON Element representation of this document.
     */
this is a manual implementation of ordered JSON items for this simple non-nested schema.
In a real-world application it is recommended to use a JSON-LD compatible library to handle normalization.
However at this point the only available one in Java support JSON-LD version 1.0, but 1.1 is required by W3C
Verifiable Credentials.

@return A normalized JSON Element representation of this document.
this is a manual implementation of ordered JSON items for this simple non - nested schema . In a real - world application it is recommended to use a JSON - LD compatible library to handle normalization . However at this point the only available one in Java support JSON - LD version 1 . 0 but 1 . 1 is required by W3C Verifiable Credentials . @return A normalized JSON Element representation of this document .
public JsonElement toNormalizedJsonElement() {
        Gson gson = JsonUtils.getGson();
        JsonObject root = gson.toJsonTree(this).getAsJsonObject();
        LinkedHashMap<String, JsonElement> map = new LinkedHashMap<>();
        for (String property : JSON_PROPERTIES_ORDER) {
            if (root.has(property)) {
                map.put(property, root.get(property));
            }
        }
        return gson.toJsonTree(map);
    }
public JsonElement toNormalizedJsonElement ( ) { Gson gson = JsonUtils . getGson ( ) ; JsonObject root = gson . toJsonTree ( this ) . getAsJsonObject ( ) ; LinkedHashMap < String , JsonElement > map = new LinkedHashMap < > ( ) ; for ( String property : JSON_PROPERTIES_ORDER ) { if ( root . has ( property ) ) { map . put ( property , root . get ( property ) ) ; } } return gson . toJsonTree ( map ) ; }
Note: this is a manual implementation of ordered JSON items for this simple non-nested schema.
Note : this is a manual implementation of ordered JSON items for this simple non - nested schema .
// First turn to normal JSON // Then put JSON properties in ordered map // Turn map to JSON