Code example for Gson

Methods: toJsonTree

0
		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) {
		return EqualsBuilder.reflectionEquals(this, obj);
	} 
	@Override 
	public String toString() {
		return ToStringBuilder.reflectionToString(this);