Code example for Gson

Methods: fromJson

0
	public JsonElement getPayloadAsElement() {
		return this.payload;
	} 
 
	public <PayloadType> PayloadType getPayload(Class<PayloadType> type) {
		Gson gson = new Gson();
		return gson.fromJson(payload, type);
	} 
 
	public void setPayload(Object payload) {
		Gson gson = new Gson();
		this.payload = gson.toJsonTree(payload);
	} 
 
	public void setPayloadJsonElement(JsonElement payload) {
		this.payload = payload;
	} 
 
	@Override 
	public boolean equals(Object obj) {
Contextual code suggestions in your IDE  Get Codota for Java