Update WaifuImage.java to better reflect API

pull/9/head
Hammy 3 years ago
parent aab72afde1
commit 8af51c289e

@ -16,7 +16,8 @@ import java.util.Objects;
* <ul> * <ul>
* <li>{@link Integer id}</li> * <li>{@link Integer id}</li>
* <li>{@link String thumbnail}</li> * <li>{@link String thumbnail}</li>
* <li>{@link String path}</li> * <li>{@link String image}</li>
* <li>{@link Boolean nsfw}</li>
* </ul> * </ul>
* *
*/ */
@ -24,9 +25,9 @@ import java.util.Objects;
@JsonPropertyOrder({ @JsonPropertyOrder({
"id", "id",
"thumbnail", "thumbnail",
"path" "image",
"nsfw"
}) })
@Generated("jsonschema2pojo")
public class WaifuImage { public class WaifuImage {
/** /**
@ -51,7 +52,15 @@ public class WaifuImage {
*/ */
@JsonProperty("path") @JsonProperty("path")
@JsonPropertyDescription("Final URL of the original resolution image") @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") @JsonProperty("id")
public Integer getId() { public Integer getId() {
@ -74,26 +83,32 @@ public class WaifuImage {
} }
@JsonProperty("path") @JsonProperty("path")
public String getPath() { public String getImage() {
return path; return image;
} }
@JsonProperty("path") @JsonProperty("path")
public void setPath(String path) { public void setImage(String image) {
this.path = path; this.image = image;
} }
@JsonProperty("nsfw")
public String getNsfw() { return nsfw; }
@JsonProperty("nsfw")
public void setNsfw(String nsfw) { this.nsfw = nsfw; }
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false; if (o == null || getClass() != o.getClass()) return false;
WaifuImage that = (WaifuImage) o; 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 @Override
public int hashCode() { public int hashCode() {
return Objects.hash(id, thumbnail, path); return Objects.hash(id, thumbnail, image, nsfw);
} }
@Override @Override
@ -101,7 +116,8 @@ public class WaifuImage {
return "WaifuImage{" + return "WaifuImage{" +
"id=" + id + "id=" + id +
", thumbnail='" + thumbnail + '\'' + ", thumbnail='" + thumbnail + '\'' +
", path='" + path + '\'' + ", image='" + image + '\'' +
", nsfw='" + nsfw + '\'' +
'}'; '}';
} }
} }

Loading…
Cancel
Save