From 65689a7ee5ca91295480435e73e1b485258fd1f7 Mon Sep 17 00:00:00 2001 From: Hammy Date: Sat, 5 Jun 2021 20:12:36 +0100 Subject: [PATCH] Add another POJO for JSON Entity The getWaifu endpoint has a creator {} block that wasn't documented in the API Reference --- .../goudham/me/api/entity/user/Creator.java | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 src/main/java/org/goudham/me/api/entity/user/Creator.java diff --git a/src/main/java/org/goudham/me/api/entity/user/Creator.java b/src/main/java/org/goudham/me/api/entity/user/Creator.java new file mode 100644 index 0000000..5b42b91 --- /dev/null +++ b/src/main/java/org/goudham/me/api/entity/user/Creator.java @@ -0,0 +1,88 @@ +package org.goudham.me.api.entity.user; + +import javax.annotation.processing.Generated; + +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import org.goudham.me.api.entity.waifu.Waifu; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; + +/** + * {@link Creator} + *

User that submitted the {@link Waifu}

+ * + *

Fields included are:

+ * + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "id", + "name" +}) +@Generated("jsonschema2pojo") +public class Creator { + + /** + * {@link Creator} ID + * + */ + @JsonProperty("id") + @JsonPropertyDescription("") + private Integer id; + + /** + * {@link Creator} Name + */ + @JsonProperty("name") + @JsonPropertyDescription("") + private String name; + + @JsonProperty("id") + public Integer getId() { + return id; + } + + @JsonProperty("id") + public void setId(Integer id) { + this.id = id; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("name") + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Creator creator = (Creator) o; + return Objects.equals(id, creator.id) && Objects.equals(name, creator.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + return "Creator{" + + "id=" + id + + ", name='" + name + '\'' + + '}'; + } +} \ No newline at end of file