2021-06-01 14:05:19 +04:00
|
|
|
package ru.ulstu.datamodel.response;
|
2020-10-01 08:41:49 +04:00
|
|
|
|
|
|
|
class ControllerResponse<D, E> {
|
|
|
|
private final D data;
|
|
|
|
private final ControllerResponseError<E> error;
|
|
|
|
|
|
|
|
ControllerResponse(D data) {
|
|
|
|
this.data = data;
|
|
|
|
this.error = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
ControllerResponse(ControllerResponseError<E> error) {
|
|
|
|
this.data = null;
|
|
|
|
this.error = error;
|
|
|
|
}
|
|
|
|
|
|
|
|
public D getData() {
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ControllerResponseError<E> getError() {
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
}
|