From 8af51c289e87d4377a63d8ba6d7c51a8cfaaa42b Mon Sep 17 00:00:00 2001 From: Hammy Date: Tue, 8 Jun 2021 19:47:12 +0100 Subject: [PATCH] Update WaifuImage.java to better reflect API --- .../goudham/api/entity/waifu/WaifuImage.java | 38 +++++++++++++------ 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/src/main/java/me/goudham/api/entity/waifu/WaifuImage.java b/src/main/java/me/goudham/api/entity/waifu/WaifuImage.java index 1ae4af0..d0e420f 100644 --- a/src/main/java/me/goudham/api/entity/waifu/WaifuImage.java +++ b/src/main/java/me/goudham/api/entity/waifu/WaifuImage.java @@ -16,7 +16,8 @@ import java.util.Objects; * * */ @@ -24,9 +25,9 @@ import java.util.Objects; @JsonPropertyOrder({ "id", "thumbnail", - "path" + "image", + "nsfw" }) -@Generated("jsonschema2pojo") public class WaifuImage { /** @@ -51,7 +52,15 @@ public class WaifuImage { */ @JsonProperty("path") @JsonPropertyDescription("Final URL of the original resolution image") - private String path; + private String image; + + /** + * If image is NSFW or not + * + */ + @JsonProperty("nsfw") + @JsonPropertyDescription("If image is NSFW or not") + private String nsfw; @JsonProperty("id") public Integer getId() { @@ -74,26 +83,32 @@ public class WaifuImage { } @JsonProperty("path") - public String getPath() { - return path; + public String getImage() { + return image; } @JsonProperty("path") - public void setPath(String path) { - this.path = path; + public void setImage(String image) { + this.image = image; } + @JsonProperty("nsfw") + public String getNsfw() { return nsfw; } + + @JsonProperty("nsfw") + public void setNsfw(String nsfw) { this.nsfw = nsfw; } + @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; WaifuImage that = (WaifuImage) o; - return Objects.equals(id, that.id) && Objects.equals(thumbnail, that.thumbnail) && Objects.equals(path, that.path); + return Objects.equals(id, that.id) && Objects.equals(thumbnail, that.thumbnail) && Objects.equals(image, that.image) && Objects.equals(nsfw, that.nsfw); } @Override public int hashCode() { - return Objects.hash(id, thumbnail, path); + return Objects.hash(id, thumbnail, image, nsfw); } @Override @@ -101,7 +116,8 @@ public class WaifuImage { return "WaifuImage{" + "id=" + id + ", thumbnail='" + thumbnail + '\'' + - ", path='" + path + '\'' + + ", image='" + image + '\'' + + ", nsfw='" + nsfw + '\'' + '}'; } }