|
|
@ -9,21 +9,21 @@ import me.goudham.api.entity.waifu.Waifu;
|
|
|
|
* <br>
|
|
|
|
* <br>
|
|
|
|
* Given a successful response, {@link #entity} will be populated with the requested entity.
|
|
|
|
* Given a successful response, {@link #entity} will be populated with the requested entity.
|
|
|
|
* <br>
|
|
|
|
* <br>
|
|
|
|
* No matter successful or unsuccessful response, {@link #responseCode} and {@link #responseBody}
|
|
|
|
* No matter successful or unsuccessful response, {@link #statusCode} and {@link #body}
|
|
|
|
* will be populated to ensure the user has all the information for debugging or extra information within
|
|
|
|
* will be populated to ensure the user has all the information for debugging or extra information within
|
|
|
|
* the {@link #responseBody}
|
|
|
|
* the {@link #body}
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param <T> The type of entity to be returned. E.g {@link Waifu} or {@link Series}
|
|
|
|
* @param <T> The type of entity to be returned. E.g {@link Waifu} or {@link Series}
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public class Response<T> {
|
|
|
|
public class Response<T> {
|
|
|
|
private final T entity;
|
|
|
|
private final T entity;
|
|
|
|
private final Integer responseCode;
|
|
|
|
private final Integer statusCode;
|
|
|
|
private final String responseBody;
|
|
|
|
private final String body;
|
|
|
|
|
|
|
|
|
|
|
|
Response(Integer responseCode, String responseBody, T entity) {
|
|
|
|
Response(Integer statusCode, String body, T entity) {
|
|
|
|
this.responseCode = responseCode;
|
|
|
|
this.statusCode = statusCode;
|
|
|
|
this.responseBody = responseBody;
|
|
|
|
this.body = body;
|
|
|
|
this.entity = entity;
|
|
|
|
this.entity = entity;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -31,11 +31,11 @@ public class Response<T> {
|
|
|
|
return entity;
|
|
|
|
return entity;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Integer getResponseCode() {
|
|
|
|
public Integer getStatusCode() {
|
|
|
|
return responseCode;
|
|
|
|
return statusCode;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String getResponseBody() {
|
|
|
|
public String getBody() {
|
|
|
|
return responseBody;
|
|
|
|
return body;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|