Code example for Gson

Methods: fromJson

0
        byte[] result = EncryptionUtils.AES.encrypt(json, symmetricKeyBytes);
        ciphertext = CMAccountUtils.encodeHex(result);
    } 
 
    public static EncryptedMessage fromJson(String json) {
        return new Gson().fromJson(json, EncryptedMessage.class);
    } 
} 
Contextual code suggestions in your IDE  Get Codota for Java