add error response model
This commit is contained in:
parent
69c5f3527b
commit
f7eb8db8b5
|
@ -4,3 +4,4 @@
|
|||
*.jar
|
||||
*.war
|
||||
*.ear
|
||||
/target
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue