CHANGE - property name of BaseResponse
This commit is contained in:
parent
e37ca91ca8
commit
80f0c08f64
@ -1,53 +1,56 @@
|
||||
package com.banesco.domain.model;
|
||||
|
||||
public class BaseResponse<T> {
|
||||
private final StatusResponse statusCode;
|
||||
private final T dataResponse;
|
||||
|
||||
private final StatusResponse status;
|
||||
private final T data;
|
||||
|
||||
private BaseResponse(Builder<T> builder) {
|
||||
this.statusCode = builder.statusCode;
|
||||
this.dataResponse = builder.dataResponse;
|
||||
this.status = builder.status;
|
||||
this.data = builder.data;
|
||||
}
|
||||
|
||||
public StatusResponse getStatusCode() {
|
||||
return statusCode;
|
||||
public StatusResponse getstatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public T getDataResponse() {
|
||||
return dataResponse;
|
||||
public T getdata() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public static class Builder<T> {
|
||||
private StatusResponse statusCode;
|
||||
private T dataResponse;
|
||||
|
||||
public Builder() {}
|
||||
private StatusResponse status;
|
||||
private T data;
|
||||
|
||||
public Builder<T> statusCode(StatusResponse statusCode) {
|
||||
this.statusCode = statusCode;
|
||||
public Builder() {
|
||||
}
|
||||
|
||||
public Builder<T> status(StatusResponse status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder<T> dataResponse(T dataResponse) {
|
||||
this.dataResponse = dataResponse;
|
||||
public Builder<T> data(T data) {
|
||||
this.data = data;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public BaseResponse<T> build() {
|
||||
// Validaciones de ser necesario
|
||||
// Validaciones de ser necesario
|
||||
// if (attr == null || attr.isEmpty()) {
|
||||
// throw new IllegalStateException("El atributo1 no puede estar vacío");
|
||||
// }
|
||||
return new BaseResponse<>(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static <T> Builder<T> builder() {
|
||||
return new Builder<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BaseResponse [statusCode=" + statusCode + ", dataResponse=" + dataResponse + "]";
|
||||
return "BaseResponse [status=" + status + ", data=" + data + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user