com.groupbyinc.common.model.Response Maven / Gradle / Ivy
package com.groupbyinc.common.model;
import java.util.List;
public class Response {
private T result;
private Status status;
public Response() {
}
public Response(T result) {
this.result = result;
this.status = new Status();
}
public Response(T result, List warnings) {
this.result = result;
this.status = new Status();
status.setAdditionalInfo(new AdditionalInfo().setWarnings(warnings));
}
public Response(T result, HttpStatus httpStatus) {
this.result = result;
this.status = new Status(httpStatus);
}
public Response(T result, HttpStatus httpStatus, List warnings) {
this.result = result;
this.status = new Status(httpStatus);
status.setAdditionalInfo(new AdditionalInfo().setWarnings(warnings));
}
public Response(List errors, HttpStatus httpStatus) {
this.status = new Status(httpStatus);
status.setAdditionalInfo(new AdditionalInfo().setErrors(errors));
}
public Response(List errors, HttpStatus httpStatus, List warnings) {
this.status = new Status(httpStatus);
status.setAdditionalInfo(new AdditionalInfo().setErrors(errors).setWarnings(warnings));
}
public Response(HttpStatus httpStatus) {
this.status = new Status(httpStatus);
}
public Response(HttpStatus httpStatus, List warnings) {
this.status = new Status(httpStatus);
}
public T getResult() {
return result;
}
public Response setResult(T result) {
this.result = result;
return this;
}
public Status getStatus() {
return status;
}
public Response setStatus(Status status) {
this.status = status;
return this;
}
}