From 8471d7a5e3c8bec242ae71ef17694e0be78b2630 Mon Sep 17 00:00:00 2001 From: Hammy Date: Sun, 6 Jun 2021 04:26:19 +0100 Subject: [PATCH] Add POJO for Response A Response<> object is what users will receive when interacting with MyWaifuClient.java --- src/main/java/org/goudham/me/Response.java | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/main/java/org/goudham/me/Response.java diff --git a/src/main/java/org/goudham/me/Response.java b/src/main/java/org/goudham/me/Response.java new file mode 100644 index 0000000..c9e2e8e --- /dev/null +++ b/src/main/java/org/goudham/me/Response.java @@ -0,0 +1,30 @@ +package org.goudham.me; + +public class Response { + 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; + } +}