Code example for Gson

Methods: fromJson

0
	} 
 
	public <ErrorDetailsType> ErrorDetailsType getErrorDetails(Class<ErrorDetailsType> type) {
		if ( errorDetails == null )
			throw new NullPointerException("No payload has been set");
		Gson gson = new Gson();
		return gson.fromJson(errorDetails, type);
	} 
	 
	public void setErrorDetails(Object errorDetails) {
		Gson gson = new Gson();
		this.errorDetails = gson.toJsonTree(errorDetails);
	} 
 
	public String getCallId() {
		return callId;
	} 
 
	public void setCallId(String callId) {
		this.callId = callId;