Update POJO's to better reflect API

The getWaifu endpoint disappointingly diverts from the API reference. Therefore changes to field names have been applied
pull/4/head
Hammy 4 years ago
parent 65689a7ee5
commit 69f4dab38e

@ -2,10 +2,7 @@ package org.goudham.me.api.entity.series;
import javax.annotation.processing.Generated; import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import org.goudham.me.api.entity.Studio; import org.goudham.me.api.entity.Studio;
import org.goudham.me.api.entity.waifu.Waifu; import org.goudham.me.api.entity.waifu.Waifu;
@ -20,12 +17,13 @@ import java.util.Objects;
* <li>{@link String name}</li> * <li>{@link String name}</li>
* <li>{@link String originalName}</li> * <li>{@link String originalName}</li>
* <li>{@link String romajiName}</li> * <li>{@link String romajiName}</li>
* <li>{@link String description}</li>
* <li>{@link String slug}</li> * <li>{@link String slug}</li>
* <li>{@link String releaseDate}</li> * <li>{@link String releaseDate}</li>
* <li>{@link String airingStart}</li> * <li>{@link String airingStart}</li>
* <li>{@link String airingEnd}</li> * <li>{@link String airingEnd}</li>
* <li>{@link Integer episodeCount}</li> * <li>{@link Integer episodeCount}</li>
* <li>{@link String image}</li> * <li>{@link String displayPicture}</li>
* <li>{@link String url}</li> * <li>{@link String url}</li>
* <li>{@link Studio}</li> * <li>{@link Studio}</li>
* <li>{@link Integer id}</li> * <li>{@link Integer id}</li>
@ -43,7 +41,7 @@ import java.util.Objects;
"airing_start", "airing_start",
"airing_end", "airing_end",
"episode_count", "episode_count",
"image", "display_picture",
"url", "url",
"studio", "studio",
"id" "id"
@ -95,6 +93,7 @@ public class Series {
* *
*/ */
@JsonProperty("release_date") @JsonProperty("release_date")
@JsonAlias("release")
@JsonPropertyDescription("Original works release date (") @JsonPropertyDescription("Original works release date (")
private String releaseDate; private String releaseDate;
@ -126,9 +125,10 @@ public class Series {
* URL of the display picture * URL of the display picture
* *
*/ */
@JsonProperty("image") @JsonProperty("display_picture")
@JsonAlias("image")
@JsonPropertyDescription("URL of the display picture") @JsonPropertyDescription("URL of the display picture")
private String image; private String displayPicture;
/** /**
* URL of the {@link Series} * URL of the {@link Series}
@ -243,13 +243,13 @@ public class Series {
} }
@JsonProperty("image") @JsonProperty("image")
public String getImage() { public String getDisplayPicture() {
return image; return displayPicture;
} }
@JsonProperty("image") @JsonProperty("image")
public void setImage(String image) { public void setDisplayPicture(String displayPicture) {
this.image = image; this.displayPicture = displayPicture;
} }
@JsonProperty("url") @JsonProperty("url")
@ -287,12 +287,12 @@ public class Series {
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;
Series series = (Series) o; Series series = (Series) o;
return Objects.equals(name, series.name) && Objects.equals(originalName, series.originalName) && Objects.equals(romajiName, series.romajiName) && Objects.equals(description, series.description) && Objects.equals(slug, series.slug) && Objects.equals(releaseDate, series.releaseDate) && Objects.equals(airingStart, series.airingStart) && Objects.equals(airingEnd, series.airingEnd) && Objects.equals(episodeCount, series.episodeCount) && Objects.equals(image, series.image) && Objects.equals(url, series.url) && Objects.equals(studio, series.studio) && Objects.equals(id, series.id); return Objects.equals(name, series.name) && Objects.equals(originalName, series.originalName) && Objects.equals(romajiName, series.romajiName) && Objects.equals(description, series.description) && Objects.equals(slug, series.slug) && Objects.equals(releaseDate, series.releaseDate) && Objects.equals(airingStart, series.airingStart) && Objects.equals(airingEnd, series.airingEnd) && Objects.equals(episodeCount, series.episodeCount) && Objects.equals(displayPicture, series.displayPicture) && Objects.equals(url, series.url) && Objects.equals(studio, series.studio) && Objects.equals(id, series.id);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(name, originalName, romajiName, description, slug, releaseDate, airingStart, airingEnd, episodeCount, image, url, studio, id); return Objects.hash(name, originalName, romajiName, description, slug, releaseDate, airingStart, airingEnd, episodeCount, displayPicture, url, studio, id);
} }
@Override @Override
@ -307,7 +307,7 @@ public class Series {
", airingStart='" + airingStart + '\'' + ", airingStart='" + airingStart + '\'' +
", airingEnd='" + airingEnd + '\'' + ", airingEnd='" + airingEnd + '\'' +
", episodeCount=" + episodeCount + ", episodeCount=" + episodeCount +
", image='" + image + '\'' + ", image='" + displayPicture + '\'' +
", url='" + url + '\'' + ", url='" + url + '\'' +
", studio=" + studio + ", studio=" + studio +
", id=" + id + ", id=" + id +

@ -6,13 +6,9 @@ import java.util.Map;
import java.util.Objects; import java.util.Objects;
import javax.annotation.processing.Generated; import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
import org.goudham.me.api.entity.series.Series; import org.goudham.me.api.entity.series.Series;
import org.goudham.me.api.entity.user.Creator;
/** /**
@ -23,9 +19,10 @@ import org.goudham.me.api.entity.series.Series;
* <ul> * <ul>
* <li>{@link Integer id}</li> * <li>{@link Integer id}</li>
* <li>{@link String slug}</li> * <li>{@link String slug}</li>
* <li>{@link Integer creatorId}</li> * <li>{@link Creator creatorId}</li>
* <li>{@link String name}</li> * <li>{@link String name}</li>
* <li>{@link String originalName}</li> * <li>{@link String originalName}</li>
* <li>{@link String romaji_name}</li>
* <li>{@link String displayPicture}</li> * <li>{@link String displayPicture}</li>
* <li>{@link String description}</li> * <li>{@link String description}</li>
* <li>{@link Double weight}</li> * <li>{@link Double weight}</li>
@ -47,7 +44,7 @@ import org.goudham.me.api.entity.series.Series;
* <li>{@link Integer popularityRank}</li> * <li>{@link Integer popularityRank}</li>
* <li>{@link Integer likeRank}</li> * <li>{@link Integer likeRank}</li>
* <li>{@link Integer trashRank}</li> * <li>{@link Integer trashRank}</li>
* <li>{@link List} of {@link Appearance}'s</li> * <li>{@link List} of {@link Series}'s</li>
* <li>{@link Series series}</li> * <li>{@link Series series}</li>
* </ul> * </ul>
* *
@ -56,9 +53,10 @@ import org.goudham.me.api.entity.series.Series;
@JsonPropertyOrder({ @JsonPropertyOrder({
"id", "id",
"slug", "slug",
"creator_id", "creator",
"name", "name",
"original_name", "original_name",
"romaji_name",
"display_picture", "display_picture",
"description", "description",
"weight", "weight",
@ -84,6 +82,7 @@ import org.goudham.me.api.entity.series.Series;
"series" "series"
}) })
@Generated("jsonschema2pojo") @Generated("jsonschema2pojo")
@JsonIgnoreProperties(ignoreUnknown = true)
public class Waifu { public class Waifu {
/** /**
* {@link Waifu} ID * {@link Waifu} ID
@ -105,9 +104,9 @@ public class Waifu {
* ID of the user who created this {@link Waifu} * ID of the user who created this {@link Waifu}
* *
*/ */
@JsonProperty("creator_id") @JsonProperty("creator")
@JsonPropertyDescription("ID of the user who created this Waifu") @JsonPropertyDescription("User who created this Waifu")
private Integer creatorId; private Creator creator;
/** /**
* Full name, in English. * Full name, in English.
@ -125,6 +124,14 @@ public class Waifu {
@JsonPropertyDescription("Name in the original language (\u65e5\u672c\u8a9e)") @JsonPropertyDescription("Name in the original language (\u65e5\u672c\u8a9e)")
private String originalName; private String originalName;
/**
* If this character has a romaji name, we'll put it here.
*
*/
@JsonProperty("romaji_name")
@JsonPropertyDescription("if this character has a romaji name, we'll put it here. ")
private String romajiName;
/** /**
* URL of the display picture * URL of the display picture
* *
@ -299,7 +306,7 @@ public class Waifu {
*/ */
@JsonProperty("appearances") @JsonProperty("appearances")
@JsonPropertyDescription("An array of series or works that this character appears in") @JsonPropertyDescription("An array of series or works that this character appears in")
private List<Appearance> appearances = null; private List<Series> appearances;
/** /**
* {@link Series} * {@link Series}
@ -330,14 +337,14 @@ public class Waifu {
this.slug = slug; this.slug = slug;
} }
@JsonProperty("creator_id") @JsonProperty("creator")
public Integer getCreatorId() { public Creator getCreator() {
return creatorId; return creator;
} }
@JsonProperty("creator_id") @JsonProperty("creator")
public void setCreatorId(Integer creatorId) { public void setCreator(Creator creator) {
this.creatorId = creatorId; this.creator = creator;
} }
@JsonProperty("name") @JsonProperty("name")
@ -360,6 +367,16 @@ public class Waifu {
this.originalName = originalName; this.originalName = originalName;
} }
@JsonProperty("romaji_name")
public String getRomajiName() {
return romajiName;
}
@JsonProperty("romaji_name")
public void setRomajiName(String romajiName) {
this.romajiName = romajiName;
}
@JsonProperty("display_picture") @JsonProperty("display_picture")
public String getDisplayPicture() { public String getDisplayPicture() {
return displayPicture; return displayPicture;
@ -571,12 +588,12 @@ public class Waifu {
} }
@JsonProperty("appearances") @JsonProperty("appearances")
public List<Appearance> getAppearances() { public List<Series> getAppearances() {
return appearances; return appearances;
} }
@JsonProperty("appearances") @JsonProperty("appearances")
public void setAppearances(List<Appearance> appearances) { public void setAppearances(List<Series> appearances) {
this.appearances = appearances; this.appearances = appearances;
} }
@ -595,12 +612,12 @@ public class Waifu {
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;
Waifu waifu = (Waifu) o; Waifu waifu = (Waifu) o;
return Objects.equals(id, waifu.id) && Objects.equals(slug, waifu.slug) && Objects.equals(creatorId, waifu.creatorId) && Objects.equals(name, waifu.name) && Objects.equals(originalName, waifu.originalName) && Objects.equals(displayPicture, waifu.displayPicture) && Objects.equals(description, waifu.description) && Objects.equals(weight, waifu.weight) && Objects.equals(height, waifu.height) && Objects.equals(bust, waifu.bust) && Objects.equals(hip, waifu.hip) && Objects.equals(waist, waifu.waist) && bloodType == waifu.bloodType && Objects.equals(origin, waifu.origin) && Objects.equals(age, waifu.age) && Objects.equals(birthdayMonth, waifu.birthdayMonth) && Objects.equals(birthdayDay, waifu.birthdayDay) && Objects.equals(birthdayYear, waifu.birthdayYear) && Objects.equals(likes, waifu.likes) && Objects.equals(trash, waifu.trash) && Objects.equals(url, waifu.url) && Objects.equals(husbando, waifu.husbando) && Objects.equals(nsfw, waifu.nsfw) && Objects.equals(popularityRank, waifu.popularityRank) && Objects.equals(likeRank, waifu.likeRank) && Objects.equals(trashRank, waifu.trashRank) && Objects.equals(appearances, waifu.appearances) && Objects.equals(series, waifu.series); return Objects.equals(id, waifu.id) && Objects.equals(slug, waifu.slug) && Objects.equals(creator, waifu.creator) && Objects.equals(name, waifu.name) && Objects.equals(originalName, waifu.originalName) && Objects.equals(displayPicture, waifu.displayPicture) && Objects.equals(description, waifu.description) && Objects.equals(weight, waifu.weight) && Objects.equals(height, waifu.height) && Objects.equals(bust, waifu.bust) && Objects.equals(hip, waifu.hip) && Objects.equals(waist, waifu.waist) && bloodType == waifu.bloodType && Objects.equals(origin, waifu.origin) && Objects.equals(age, waifu.age) && Objects.equals(birthdayMonth, waifu.birthdayMonth) && Objects.equals(birthdayDay, waifu.birthdayDay) && Objects.equals(birthdayYear, waifu.birthdayYear) && Objects.equals(likes, waifu.likes) && Objects.equals(trash, waifu.trash) && Objects.equals(url, waifu.url) && Objects.equals(husbando, waifu.husbando) && Objects.equals(nsfw, waifu.nsfw) && Objects.equals(popularityRank, waifu.popularityRank) && Objects.equals(likeRank, waifu.likeRank) && Objects.equals(trashRank, waifu.trashRank) && Objects.equals(appearances, waifu.appearances) && Objects.equals(series, waifu.series);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(id, slug, creatorId, name, originalName, displayPicture, description, weight, height, bust, hip, waist, bloodType, origin, age, birthdayMonth, birthdayDay, birthdayYear, likes, trash, url, husbando, nsfw, popularityRank, likeRank, trashRank, appearances, series); return Objects.hash(id, slug, creator, name, originalName, displayPicture, description, weight, height, bust, hip, waist, bloodType, origin, age, birthdayMonth, birthdayDay, birthdayYear, likes, trash, url, husbando, nsfw, popularityRank, likeRank, trashRank, appearances, series);
} }
@Override @Override
@ -608,7 +625,7 @@ public class Waifu {
return "Waifu{" + return "Waifu{" +
"id=" + id + "id=" + id +
", slug='" + slug + '\'' + ", slug='" + slug + '\'' +
", creatorId=" + creatorId + ", creatorId=" + creator +
", name='" + name + '\'' + ", name='" + name + '\'' +
", originalName='" + originalName + '\'' + ", originalName='" + originalName + '\'' +
", displayPicture='" + displayPicture + '\'' + ", displayPicture='" + displayPicture + '\'' +

Loading…
Cancel
Save