package org.bench4q.share.models;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "error")
public class ErrorResponseModel {
	private String code;
	private String message;
	private String resource;

	@XmlElement
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@XmlElement
	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	@XmlElement
	public String getResource() {
		return resource;
	}

	public void setResource(String resource) {
		this.resource = resource;
	}

	public static ErrorResponseModel buildErrorResponse(String code, String message,
			String resource) {
		ErrorResponseModel errorResponse = new ErrorResponseModel();
		errorResponse.setCode(code);
		errorResponse.setMessage(message);
		errorResponse.setResource(resource);
		return errorResponse;
	}
}
