Add POJO for Response
A Response<> object is what users will receive when interacting with MyWaifuClient.javapull/5/head
parent
e6baaef299
commit
8471d7a5e3
@ -0,0 +1,30 @@
|
|||||||
|
package org.goudham.me;
|
||||||
|
|
||||||
|
public class Response<T> {
|
||||||
|
private T entity;
|
||||||
|
private final Integer responseCode;
|
||||||
|
private final String responseBody;
|
||||||
|
|
||||||
|
Response(Integer responseCode, String responseBody, T entity) {
|
||||||
|
this.responseCode = responseCode;
|
||||||
|
this.responseBody = responseBody;
|
||||||
|
this.entity = entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
Response(Integer responseCode, String responseBody) {
|
||||||
|
this.responseCode = responseCode;
|
||||||
|
this.responseBody = responseBody;
|
||||||
|
}
|
||||||
|
|
||||||
|
public T getEntity() {
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getResponseCode() {
|
||||||
|
return responseCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getResponseBody() {
|
||||||
|
return responseBody;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue