diff --git a/.gitignore b/.gitignore index 0f182a03..d87a8e28 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ -*.class - -# Package Files # -*.jar -*.war -*.ear +*.class + +# Package Files # +*.jar +*.war +*.ear +/target diff --git a/src/main/java/org/bench4q/share/models/ErrorResponseModel.java b/src/main/java/org/bench4q/share/models/ErrorResponseModel.java new file mode 100644 index 00000000..dfabadea --- /dev/null +++ b/src/main/java/org/bench4q/share/models/ErrorResponseModel.java @@ -0,0 +1,47 @@ +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; + } +}