Merge pull request #2 from sgoudham/main

Test Release To Nexus Repository
pull/3/head
Hamothy 3 years ago committed by GitHub
commit 4698affad5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

94
Jenkinsfile vendored

@ -0,0 +1,94 @@
pipeline {
agent {
docker {
image "maven:3.8.1-adoptopenjdk-11"
args '-v /root/.m2:/root/.m2'
}
}
environment {
NEXUS_VERSION = "nexus3"
NEXUS_PROTOCOL = "https"
NEXUS_REPOSITORY = "maven-goudham"
NEXUS_URL = credentials('fe3e0c7e-bcb1-4d55-9591-f55f71f42356')
NEXUS_CREDENTIAL_ID = 'e5582b32-3507-4e88-ab7c-d16d701c46e9'
CODECOV_TOKEN = credentials('44a3c021-5cbb-4a6f-bea2-ae6c51d43038')
}
stages {
stage("Building") {
steps {
sh "mvn -B -DskipTests clean install"
}
}
stage("Testing") {
steps {
sh "mvn test"
}
}
stage("Deploying To Nexus") {
when {
branch 'release'
}
steps {
script {
pom = readMavenPom file: "pom.xml";
filesByGlob = findFiles(glob: "target/*.${pom.packaging}");
echo "${filesByGlob[0].name} ${filesByGlob[0].path} ${filesByGlob[0].directory} ${filesByGlob[0].length} ${filesByGlob[0].lastModified}"
artifactPath = filesByGlob[0].path;
artifactExists = fileExists artifactPath;
if (artifactExists) {
echo "*** File: ${artifactPath}, group: ${pom.groupId}, packaging: ${pom.packaging}, version ${pom.version}";
nexusArtifactUploader(
nexusVersion: NEXUS_VERSION,
protocol: NEXUS_PROTOCOL,
nexusUrl: NEXUS_URL,
groupId: pom.groupId,
version: pom.version,
repository: NEXUS_REPOSITORY,
credentialsId: NEXUS_CREDENTIAL_ID,
artifacts: [
[artifactId: pom.artifactId,
classifier: '',
file: artifactPath,
type: pom.packaging],
[artifactId: pom.artifactId,
classifier: '',
file: "pom.xml",
type: "pom"]
]
)
} else {
error "*** File: ${artifactPath}, could not be found";
}
}
}
}
}
post {
success {
echo "I'm Feeling Swag!"
echo "Generating Test Report..."
publishCoverage adapters: [jacocoAdapter('target/site/jacoco/jacoco.xml')]
echo "Sending Report to CodeCov..."
sh '''#!/bin/bash
bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN || echo "Codecov did not collect coverage reports"
'''
}
failure {
echo 'Not Very Swag :('
}
cleanup {
cleanWs()
}
}
}

@ -1,55 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.goudham.me</groupId> <groupId>org.goudham.me</groupId>
<artifactId>MyWaifuWrapper</artifactId> <artifactId>MyWaifuWrapper</artifactId>
<version>0.1</version> <version>0.1</version>
<name>MyWaifuWrapper</name> <name>MyWaifuWrapper</name>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source> <maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target> <maven.compiler.target>11</maven.compiler.target>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.junit.jupiter</groupId> <groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId> <artifactId>junit-jupiter-api</artifactId>
<version>5.7.2</version> <version>5.7.2</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.mockito</groupId> <groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId> <artifactId>mockito-core</artifactId>
<version>3.10.0</version> <version>3.10.0</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jetbrains</groupId> <groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId> <artifactId>annotations</artifactId>
<version>RELEASE</version> <version>21.0.1</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId> <artifactId>jackson-databind</artifactId>
<version>2.12.3</version> <version>2.12.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId> <artifactId>jackson-core</artifactId>
<version>2.12.3</version> <version>2.12.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId> <artifactId>jackson-annotations</artifactId>
<version>2.12.3</version> <version>2.12.3</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>

@ -0,0 +1,124 @@
package org.goudham.me;
import org.goudham.me.api.MyWaifuWrapper;
import org.jetbrains.annotations.NotNull;
import javax.net.ssl.SSLParameters;
import java.net.Authenticator;
import java.net.CookieHandler;
import java.net.ProxySelector;
import java.net.http.HttpClient;
import java.time.Duration;
import java.util.concurrent.Executor;
/**
* A MyWaifuClient
*
* <p> Main entry point for retrieving information from MyWaifuList.</p>
* <p> {@link MyWaifuWrapper} is utilised to make the API requests </p>
*/
public class MyWaifuClient {
private final MyWaifuWrapper myWaifuWrapper;
private HttpClient httpClient;
/**
* Creates an instance of MyWaifuClient
*
* <p>See <a href="https://mywaifulist.docs.stoplight.io/">MyWaifuList</a> for obtaining an API Key</p>
* @param apiKey API Key to authorise API request
*/
MyWaifuClient(@NotNull String apiKey) {
myWaifuWrapper = new MyWaifuWrapper(apiKey);
}
/**
* Creates an instance of {@link MyWaifuClient} with default {@link HttpClient} settings
*
* @param apiKey API Key to authorise API request
* @return {@link MyWaifuClient}
*/
public static MyWaifuClient createDefault(@NotNull String apiKey) {
MyWaifuClient myWaifuClient = new MyWaifuClient(apiKey);
myWaifuClient.setHttpClient(HttpClient.newBuilder()
.version(HttpClient.Version.HTTP_2)
.followRedirects(HttpClient.Redirect.NORMAL)
.connectTimeout(Duration.ofSeconds(20))
.build());
return myWaifuClient;
}
/**
* Sets an instance of HttpClient
*
* @param httpClient HttpClient for executing API requests
*/
public void setHttpClient(HttpClient httpClient) {
this.httpClient = httpClient;
}
/**
* Builder for MyWaifuClient
*/
public static class Builder {
private final String apiKey;
private final MyWaifuWrapper myWaifuWrapper;
private HttpClient.Builder httpClientBuilder;
public Builder(String apiKey) {
this.apiKey = apiKey;
myWaifuWrapper = new MyWaifuWrapper(apiKey);
}
public Builder withCookieHandler(CookieHandler cookieHandler) {
httpClientBuilder.cookieHandler(cookieHandler);
return this;
}
public Builder withConnectTimeout(Duration duration) {
httpClientBuilder.connectTimeout(duration);
return this;
}
public Builder withSslParameters(SSLParameters sslParameters) {
httpClientBuilder.sslParameters(sslParameters);
return this;
}
public Builder withExecutor(Executor executor) {
httpClientBuilder.executor(executor);
return this;
}
public Builder withFollowRedirects(HttpClient.Redirect policy) {
httpClientBuilder.followRedirects(policy);
return this;
}
public Builder withVersion(HttpClient.Version version) {
httpClientBuilder.version(version);
return this;
}
public Builder withPriority(int priority) {
httpClientBuilder.priority(priority);
return this;
}
public Builder withProxy(ProxySelector proxySelector) {
httpClientBuilder.proxy(proxySelector);
return this;
}
public Builder withAuthenticator(Authenticator authenticator) {
httpClientBuilder.authenticator(authenticator);
return this;
}
public MyWaifuClient build() {
MyWaifuClient myWaifuClient = new MyWaifuClient(apiKey);
myWaifuClient.setHttpClient(httpClientBuilder.build());
return myWaifuClient;
}
}
}

@ -0,0 +1,20 @@
package org.goudham.me.api;
import org.goudham.me.MyWaifuClient;
/**
* Returns API information to {@link MyWaifuClient}
*/
public class MyWaifuWrapper {
private final String version = "1.0";
private final String host = "https://mywaifulist.moe/api/v1/";
private final String apiKey;
/**
* Instantiates an instance of {@link MyWaifuWrapper} to retrieve API Information
* @param apiKey API Key to authorise API request
*/
public MyWaifuWrapper(String apiKey) {
this.apiKey = apiKey;
}
}

@ -0,0 +1,105 @@
package org.goudham.me.api.entity;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* {@link PaginationData}
* <p>Contains standard Pagination data from the API</p>
*
* <p> Fields included are: </p>
* <ul>
* <li>{@link Integer currentPage}</li>
* <li>{@link Integer lastPage}</li>
* <li>{@link Integer perPage}</li>
* <li>{@link Integer total}</li>
* </ul>
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"current_page",
"last_page",
"per_page",
"total"
})
@Generated("jsonschema2pojo")
public class PaginationData {
/**
* Current requested page
*
*/
@JsonProperty("current_page")
@JsonPropertyDescription("Current requested page")
private Integer currentPage;
/**
* Last available page
*
*/
@JsonProperty("last_page")
@JsonPropertyDescription("Last available page")
private Integer lastPage;
/**
* Total number of items per page
*
*/
@JsonProperty("per_page")
@JsonPropertyDescription("Total number of items per page")
private Integer perPage;
/**
* Total number of items
*
*/
@JsonProperty("total")
@JsonPropertyDescription("Total number of items")
private Integer total;
@JsonProperty("current_page")
public Integer getCurrentPage() {
return currentPage;
}
@JsonProperty("current_page")
public void setCurrentPage(Integer currentPage) {
this.currentPage = currentPage;
}
@JsonProperty("last_page")
public Integer getLastPage() {
return lastPage;
}
@JsonProperty("last_page")
public void setLastPage(Integer lastPage) {
this.lastPage = lastPage;
}
@JsonProperty("per_page")
public Integer getPerPage() {
return perPage;
}
@JsonProperty("per_page")
public void setPerPage(Integer perPage) {
this.perPage = perPage;
}
@JsonProperty("total")
public Integer getTotal() {
return total;
}
@JsonProperty("total")
public void setTotal(Integer total) {
this.total = total;
}
}

@ -0,0 +1,105 @@
package org.goudham.me.api.entity;
import javax.annotation.processing.Generated;
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 java.util.Objects;
/**
* {@link Studio}
* <p> Contains information on a given animation or game development studio </p>
*
* <p>Fields included are:</p>
* <ul>
* <li>{@link Integer id}</li>
* <li>{@link String name}</li>
* <li>{@link String originalName}</li>
* </ul>
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"id",
"name",
"original_name"
})
@Generated("jsonschema2pojo")
public class Studio {
/**
* {@link Studio} ID
*/
@JsonProperty("id")
@JsonPropertyDescription("Studio ID")
private Integer id;
/**
* {@link Studio} Name
*/
@JsonProperty("name")
@JsonPropertyDescription("Studio Name")
private String name;
/**
* {@link Studio}'s Original Name
*/
@JsonProperty("original_name")
@JsonPropertyDescription("Studio's Original Name")
private String originalName;
@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;
}
@JsonProperty("original_name")
public String getOriginalName() {
return originalName;
}
@JsonProperty("original_name")
public void setOriginalName(String originalName) {
this.originalName = originalName;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Studio studio = (Studio) o;
return Objects.equals(id, studio.id) && Objects.equals(name, studio.name) && Objects.equals(originalName, studio.originalName);
}
@Override
public int hashCode() {
return Objects.hash(id, name, originalName);
}
@Override
public String toString() {
return "Studio{" +
"id=" + id +
", name='" + name + '\'' +
", originalName='" + originalName + '\'' +
'}';
}
}

@ -0,0 +1,192 @@
package org.goudham.me.api.entity.series;
import javax.annotation.processing.Generated;
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 java.util.Objects;
/**
* {@link FilteredSeries}
* <p> Contains basic series information for most endpoints </p>
*
* <p> Fields included are: </p>
* <ul>
* <li>{@link String name}</li>
* <li>{@link String originalName}</li>
* <li>{@link String romajiName}</li>
* <li>{@link String slug}</li>
* <li>{@link String description}</li>
* <li>{@link String url}</li>
* <li>{@link Integer id}</li>
* </ul>
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"name",
"original_name",
"romaji_name",
"slug",
"description",
"url",
"id"
})
@Generated("jsonschema2pojo")
public class FilteredSeries {
/**
* Full name, in English.
*
*/
@JsonProperty("name")
@JsonPropertyDescription("Full name, in English.")
private String name;
/**
* Name in the original language ()
*
*/
@JsonProperty("original_name")
@JsonPropertyDescription("Name in the original language (\u65e5\u672c\u8a9e)")
private String originalName;
/**
* If this {@link Series} 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;
/**
* Readable URL's for this {@link Series}
*
*/
@JsonProperty("slug")
@JsonPropertyDescription("Used to generate readable URL's for the Waifu")
private String slug;
/**
* Truncated, spoiler-free description of this {@link Series}
*
*/
@JsonProperty("description")
@JsonPropertyDescription("Truncated, spoiler-free description of this Waifu")
private String description;
/**
* URL to view in browser
*
*/
@JsonProperty("url")
@JsonPropertyDescription("URL to view in browser")
private String url;
/**
* Interal ID of this {@link Series}
*/
@JsonProperty("id")
@JsonPropertyDescription("Internal ID of the series")
private Integer id;
@JsonProperty("name")
public String getName() {
return name;
}
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
@JsonProperty("original_name")
public String getOriginalName() {
return originalName;
}
@JsonProperty("original_name")
public void setOriginalName(String originalName) {
this.originalName = originalName;
}
@JsonProperty("romaji_name")
public String getRomajiName() {
return romajiName;
}
@JsonProperty("romaji_name")
public void setRomajiName(String romajiName) {
this.romajiName = romajiName;
}
@JsonProperty("slug")
public String getSlug() {
return slug;
}
@JsonProperty("slug")
public void setSlug(String slug) {
this.slug = slug;
}
@JsonProperty("description")
public String getDescription() {
return description;
}
@JsonProperty("description")
public void setDescription(String description) {
this.description = description;
}
@JsonProperty("url")
public String getUrl() {
return url;
}
@JsonProperty("url")
public void setUrl(String url) {
this.url = url;
}
@JsonProperty("id")
public Integer getId() {
return id;
}
@JsonProperty("id")
public void setId(Integer id) {
this.id = id;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
FilteredSeries that = (FilteredSeries) o;
return Objects.equals(name, that.name) && Objects.equals(originalName, that.originalName) && Objects.equals(romajiName, that.romajiName) && Objects.equals(slug, that.slug) && Objects.equals(description, that.description) && Objects.equals(url, that.url) && Objects.equals(id, that.id);
}
@Override
public int hashCode() {
return Objects.hash(name, originalName, romajiName, slug, description, url, id);
}
@Override
public String toString() {
return "FilteredSeries{" +
"name='" + name + '\'' +
", originalName='" + originalName + '\'' +
", romajiName='" + romajiName + '\'' +
", slug='" + slug + '\'' +
", description='" + description + '\'' +
", url='" + url + '\'' +
", id=" + id +
'}';
}
}

@ -0,0 +1,316 @@
package org.goudham.me.api.entity.series;
import javax.annotation.processing.Generated;
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 org.goudham.me.api.entity.Studio;
import org.goudham.me.api.entity.waifu.Waifu;
import java.util.Objects;
/**
* {@link Series}
* <p>Represents a grouping of various {@link Waifu}'s. This can be an anime, mobile game, video game, manga, or LN</p>
*
* <p> Fields included are: </p>
* <ul>
* <li>{@link String name}</li>
* <li>{@link String originalName}</li>
* <li>{@link String romajiName}</li>
* <li>{@link String slug}</li>
* <li>{@link String releaseDate}</li>
* <li>{@link String airingStart}</li>
* <li>{@link String airingEnd}</li>
* <li>{@link Integer episodeCount}</li>
* <li>{@link String image}</li>
* <li>{@link String url}</li>
* <li>{@link Studio}</li>
* <li>{@link Integer id}</li>
* </ul>
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"name",
"original_name",
"romaji_name",
"description",
"slug",
"release_date",
"airing_start",
"airing_end",
"episode_count",
"image",
"url",
"studio",
"id"
})
@Generated("jsonschema2pojo")
public class Series {
/**
* Full Name (in English)
*
*/
@JsonProperty("name")
@JsonPropertyDescription("Full Name (in English)")
private String name;
/**
* Name in the original language ()
*
*/
@JsonProperty("original_name")
@JsonPropertyDescription("Name in the original language (\u65e5\u672c\u8a9e)")
private String originalName;
/**
* Romanization of this {@link Series} name
*
*/
@JsonProperty("romaji_name")
@JsonPropertyDescription("Romanization of this Series name")
private String romajiName;
/**
* Spoiler-free description of the {@link Series}, work, etc
*
*/
@JsonProperty("description")
@JsonPropertyDescription("Spoiler-free description of the series, work, etc")
private String description;
/**
* Used to generate readable URL's for the {@link Series}
*
*/
@JsonProperty("slug")
@JsonPropertyDescription("Used to generate readable URL's for the Series")
private String slug;
/**
* Original works release date (
*
*/
@JsonProperty("release_date")
@JsonPropertyDescription("Original works release date (")
private String releaseDate;
/**
* The works airing start date
*
*/
@JsonProperty("airing_start")
@JsonPropertyDescription("The works airing start date")
private String airingStart;
/**
* The works airing end date
*
*/
@JsonProperty("airing_end")
@JsonPropertyDescription("The works airing end date")
private String airingEnd;
/**
* The number of episodes in this work. 1 if OVA or Movie.
*
*/
@JsonProperty("episode_count")
@JsonPropertyDescription("The number of episodes in this work. 1 if OVA or Movie.")
private Integer episodeCount;
/**
* URL of the display picture
*
*/
@JsonProperty("image")
@JsonPropertyDescription("URL of the display picture")
private String image;
/**
* URL of the {@link Series}
*/
@JsonProperty("url")
private String url;
/**
* {@link Studio}
* <p>
* Contains information on a given animation or game development studio
*
*/
@JsonProperty("studio")
@JsonPropertyDescription("Contains information on a given animation or game development studio")
private Studio studio;
/**
* The internal ID of the {@link Series}
*
*/
@JsonProperty("id")
@JsonPropertyDescription("The internal ID of the Series")
private Integer id;
@JsonProperty("name")
public String getName() {
return name;
}
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
@JsonProperty("original_name")
public String getOriginalName() {
return originalName;
}
@JsonProperty("original_name")
public void setOriginalName(String originalName) {
this.originalName = originalName;
}
@JsonProperty("romaji_name")
public String getRomajiName() {
return romajiName;
}
@JsonProperty("romaji_name")
public void setRomajiName(String romajiName) {
this.romajiName = romajiName;
}
@JsonProperty("description")
public String getDescription() {
return description;
}
@JsonProperty("description")
public void setDescription(String description) {
this.description = description;
}
@JsonProperty("slug")
public String getSlug() {
return slug;
}
@JsonProperty("slug")
public void setSlug(String slug) {
this.slug = slug;
}
@JsonProperty("release_date")
public String getReleaseDate() {
return releaseDate;
}
@JsonProperty("release_date")
public void setReleaseDate(String releaseDate) {
this.releaseDate = releaseDate;
}
public String getAiringStart() {
return airingStart;
}
public void setAiringStart(String airingStart) {
this.airingStart = airingStart;
}
@JsonProperty("airing_end")
public String getAiringEnd() {
return airingEnd;
}
@JsonProperty("airing_end")
public void setAiringEnd(String airingEnd) {
this.airingEnd = airingEnd;
}
@JsonProperty("episode_count")
public Integer getEpisodeCount() {
return episodeCount;
}
@JsonProperty("episode_count")
public void setEpisodeCount(Integer episodeCount) {
this.episodeCount = episodeCount;
}
@JsonProperty("image")
public String getImage() {
return image;
}
@JsonProperty("image")
public void setImage(String image) {
this.image = image;
}
@JsonProperty("url")
public String getUrl() {
return url;
}
@JsonProperty("url")
public void setUrl(String url) {
this.url = url;
}
@JsonProperty("studio")
public Studio getStudio() {
return studio;
}
@JsonProperty("studio")
public void setStudio(Studio studio) {
this.studio = studio;
}
@JsonProperty("id")
public Integer getId() {
return id;
}
@JsonProperty("id")
public void setId(Integer id) {
this.id = id;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
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);
}
@Override
public int hashCode() {
return Objects.hash(name, originalName, romajiName, description, slug, releaseDate, airingStart, airingEnd, episodeCount, image, url, studio, id);
}
@Override
public String toString() {
return "Series{" +
"name='" + name + '\'' +
", originalName='" + originalName + '\'' +
", romajiName='" + romajiName + '\'' +
", description='" + description + '\'' +
", slug='" + slug + '\'' +
", releaseDate='" + releaseDate + '\'' +
", airingStart='" + airingStart + '\'' +
", airingEnd='" + airingEnd + '\'' +
", episodeCount=" + episodeCount +
", image='" + image + '\'' +
", url='" + url + '\'' +
", studio=" + studio +
", id=" + id +
'}';
}
}

@ -0,0 +1,105 @@
package org.goudham.me.api.entity.user;
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 org.goudham.me.api.entity.series.Series;
import javax.annotation.processing.Generated;
import java.util.Objects;
/**
* {@link TrueLove}
* <p>Represents a {@link User}'s True Love</p>
*
* <p> Fields included are: </p>
* <ul>
* <li>{@link String name}</li>
* <li>{@link String slug}</li>
* <li>{@link String series}</li>
* </ul>
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"name",
"slug",
"series"
})
@Generated("jsonschema2pojo")
public class TrueLove {
/**
* Name of {@link TrueLove}
*/
@JsonProperty("name")
@JsonPropertyDescription("Name of True Love")
private String name;
/**
* Slug value of {@link TrueLove}
*/
@JsonProperty("slug")
@JsonPropertyDescription("Slug value of True Love")
private String slug;
/**
* {@link Series} that this {@link TrueLove} is part of
*/
@JsonProperty("series")
@JsonPropertyDescription("Series that this TrueLove is part of")
private String series;
@JsonProperty("name")
public String getName() {
return name;
}
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
@JsonProperty("slug")
public String getSlug() {
return slug;
}
@JsonProperty("slug")
public void setSlug(String slug) {
this.slug = slug;
}
@JsonProperty("series")
public String getSeries() {
return series;
}
@JsonProperty("series")
public void setSeries(String series) {
this.series = series;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TrueLove trueLove = (TrueLove) o;
return Objects.equals(name, trueLove.name) && Objects.equals(slug, trueLove.slug) && Objects.equals(series, trueLove.series);
}
@Override
public int hashCode() {
return Objects.hash(name, slug, series);
}
@Override
public String toString() {
return "TrueLove{" +
"name='" + name + '\'' +
", slug='" + slug + '\'' +
", series='" + series + '\'' +
'}';
}
}

@ -0,0 +1,211 @@
package org.goudham.me.api.entity.user;
import javax.annotation.processing.Generated;
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 org.goudham.me.api.entity.waifu.Waifu;
import java.util.Objects;
/**
* {@link User}
* <p>Standard user information and counts of waifus created, liked, trashed. Also contains true love</p>
*
* <p> Fields included are: </p>
* <ul>
* <li>{@link Integer id}</li>
* <li>{@link String name}</li>
* <li>{@link String twitter}</li>
* <li>{@link String joined}</li>
* <li>{@link Integer waifusCreated}</li>
* <li>{@link Integer waifusLiked}</li>
* <li>{@link Integer waifusTrashed}</li>
* <li>{@link TrueLove trueLove}</li>
* </ul>
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"id",
"name",
"twitter",
"joined",
"waifus_created",
"waifus_liked",
"waifus_trashed",
"true_love"
})
@Generated("jsonschema2pojo")
public class User {
/**
* {@link User} ID
*/
@JsonProperty("id")
private Integer id;
/**
* {@link User}'s display name, or twitter name
*
*/
@JsonProperty("name")
@JsonPropertyDescription("User's display name, or twitter name")
private String name;
/**
* {@link User}'s Twitter Handle
*
*/
@JsonProperty("twitter")
@JsonPropertyDescription("User's Twitter Handle")
private String twitter;
/**
* ISO 8601 date when {@link User} joined
*
*/
@JsonProperty("joined")
@JsonPropertyDescription("ISO 8601 date when user joined")
private String joined;
/**
* Number of {@link Waifu}'s this {@link User} has created
*
*/
@JsonProperty("waifus_created")
@JsonPropertyDescription("Number of Waifu's this user has created")
private Integer waifusCreated;
/**
* Number of {@link Waifu}'s this {@link User} has liked
*
*/
@JsonProperty("waifus_liked")
@JsonPropertyDescription("Number of Waifu's this user has liked")
private Integer waifusLiked;
/**
* Number of {@link Waifu}'s this {@link User} has trashed
*
*/
@JsonProperty("waifus_trashed")
@JsonPropertyDescription("Number of Waifu's this user has trashed")
private Integer waifusTrashed;
/**
* <p>User's {@link TrueLove}</p>
*/
@JsonProperty("true_love")
private TrueLove trueLove;
@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;
}
@JsonProperty("twitter")
public String getTwitter() {
return twitter;
}
@JsonProperty("twitter")
public void setTwitter(String twitter) {
this.twitter = twitter;
}
@JsonProperty("joined")
public String getJoined() {
return joined;
}
@JsonProperty("joined")
public void setJoined(String joined) {
this.joined = joined;
}
@JsonProperty("waifus_created")
public Integer getWaifusCreated() {
return waifusCreated;
}
@JsonProperty("waifus_created")
public void setWaifusCreated(Integer waifusCreated) {
this.waifusCreated = waifusCreated;
}
@JsonProperty("waifus_liked")
public Integer getWaifusLiked() {
return waifusLiked;
}
@JsonProperty("waifus_liked")
public void setWaifusLiked(Integer waifusLiked) {
this.waifusLiked = waifusLiked;
}
@JsonProperty("waifus_trashed")
public Integer getWaifusTrashed() {
return waifusTrashed;
}
@JsonProperty("waifus_trashed")
public void setWaifusTrashed(Integer waifusTrashed) {
this.waifusTrashed = waifusTrashed;
}
@JsonProperty("true_love")
public TrueLove getTrueLove() {
return trueLove;
}
@JsonProperty("true_love")
public void setTrueLove(TrueLove trueLove) {
this.trueLove = trueLove;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
User user = (User) o;
return Objects.equals(id, user.id) && Objects.equals(name, user.name) && Objects.equals(twitter, user.twitter) && Objects.equals(joined, user.joined) && Objects.equals(waifusCreated, user.waifusCreated) && Objects.equals(waifusLiked, user.waifusLiked) && Objects.equals(waifusTrashed, user.waifusTrashed) && Objects.equals(trueLove, user.trueLove);
}
@Override
public int hashCode() {
return Objects.hash(id, name, twitter, joined, waifusCreated, waifusLiked, waifusTrashed, trueLove);
}
@Override
public String toString() {
return "User{" +
"id=" + id +
", name='" + name + '\'' +
", twitter='" + twitter + '\'' +
", joined='" + joined + '\'' +
", waifusCreated=" + waifusCreated +
", waifusLiked=" + waifusLiked +
", waifusTrashed=" + waifusTrashed +
", trueLove=" + trueLove +
'}';
}
}

@ -0,0 +1,129 @@
package org.goudham.me.api.entity.user;
import java.util.List;
import java.util.Objects;
import javax.annotation.processing.Generated;
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 org.goudham.me.api.entity.waifu.Waifu;
/**
* {@link UserList}
* <p>Get an array of all user lists on their profile</p>
*
* <p> Fields included are: </p>
* <ul>
* <li>{@link Integer id}</li>
* <li>{@link String name}</li>
* <li>{@link String order}</li>
* <li>{@link List} of {@link Waifu}'s</li>
* </ul>
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"id",
"name",
"order",
"waifus"
})
@Generated("jsonschema2pojo")
public class UserList {
/**
* {@link UserList} ID
*
*/
@JsonProperty("id")
@JsonPropertyDescription("UserList ID")
private Integer id;
/**
* {@link UserList} Name
*
*/
@JsonProperty("name")
@JsonPropertyDescription("UserList Name")
private String name;
/**
* Order this appears in the {@link UserList}
*
*/
@JsonProperty("order")
@JsonPropertyDescription("Order this appears in the UserList")
private Integer order;
/**
* List of {@link Waifu}'s within the {@link UserList}
*
*/
@JsonProperty("waifus")
@JsonPropertyDescription("List of Waifu's within the UserList")
private List<Waifu> waifus;
@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;
}
@JsonProperty("order")
public Integer getOrder() {
return order;
}
@JsonProperty("order")
public void setOrder(Integer order) {
this.order = order;
}
@JsonProperty("waifus")
public List<Waifu> getWaifus() {
return waifus;
}
@JsonProperty("waifus")
public void setWaifus(List<Waifu> waifus) {
this.waifus = waifus;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
UserList userList = (UserList) o;
return Objects.equals(id, userList.id) && Objects.equals(name, userList.name) && Objects.equals(order, userList.order) && Objects.equals(waifus, userList.waifus);
}
@Override
public int hashCode() {
return Objects.hash(id, name, order, waifus);
}
@Override
public String toString() {
return "UserList{" +
"id=" + id +
", name='" + name + '\'' +
", order=" + order +
", waifus=" + waifus +
'}';
}
}

@ -0,0 +1,125 @@
package org.goudham.me.api.entity.waifu;
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 javax.annotation.processing.Generated;
/**
* {@link Appearance}
* <p>Contains basic series information for most endpoints</p>
*
* <p> Fields included are: </p>
* <ul>
* <li>{@link String name}</li>
* <li>{@link String originalName}</li>
* <li>{@link String romajiName}</li>
* <li>{@link String slug}</li>
* <li>{@link String description}</li>
* <li>{@link String url}</li>
* <li>{@link Integer id}</li>
* </ul>
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"name",
"original_name",
"romaji_name",
"slug",
"description",
"url",
"id"
})
@Generated("jsonschema2pojo")
public class Appearance {
@JsonProperty("name")
private String name;
@JsonProperty("original_name")
private String originalName;
@JsonProperty("romaji_name")
private String romajiName;
@JsonProperty("slug")
private String slug;
@JsonProperty("description")
private String description;
@JsonProperty("url")
private String url;
@JsonProperty("id")
@JsonPropertyDescription("Internal ID of the series")
private Integer id;
@JsonProperty("name")
public String getName() {
return name;
}
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
@JsonProperty("original_name")
public String getOriginalName() {
return originalName;
}
@JsonProperty("original_name")
public void setOriginalName(String originalName) {
this.originalName = originalName;
}
@JsonProperty("romaji_name")
public String getRomajiName() {
return romajiName;
}
@JsonProperty("romaji_name")
public void setRomajiName(String romajiName) {
this.romajiName = romajiName;
}
@JsonProperty("slug")
public String getSlug() {
return slug;
}
@JsonProperty("slug")
public void setSlug(String slug) {
this.slug = slug;
}
@JsonProperty("description")
public String getDescription() {
return description;
}
@JsonProperty("description")
public void setDescription(String description) {
this.description = description;
}
@JsonProperty("url")
public String getUrl() {
return url;
}
@JsonProperty("url")
public void setUrl(String url) {
this.url = url;
}
@JsonProperty("id")
public Integer getId() {
return id;
}
@JsonProperty("id")
public void setId(Integer id) {
this.id = id;
}
}

@ -0,0 +1,273 @@
package org.goudham.me.api.entity.waifu;
import java.util.List;
import java.util.Objects;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* Filtered Waifu
* <p>Contains Waifu data structure for endpoints other than the primary endpoint (/waifu/{slug})</p>
*
* <p> Fields included are: </p>
* <ul>
* <li>{@link String slug}</li>
* <li>{@link String name}</li>
* <li>{@link String originalName}</li>
* <li>{@link String romajiName}</li>
* <li>{@link String displayPicture}</li>
* <li>{@link Integer likes}</li>
* <li>{@link Integer trash}</li>
* <li>{@link Integer episodeCount}</li>
* <li>{@link String url}</li>
* <li>{@link List} of {@link Appearance}'s</li>
* <li>{@link Double id}</li>
* </ul>
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"slug",
"name",
"original_name",
"romaji_name",
"display_picture",
"description",
"likes",
"trash",
"url",
"appearances",
"id"
})
@Generated("jsonschema2pojo")
public class FilteredWaifu {
/**
* Used to generate readable URL's for the Waifu
*
*/
@JsonProperty("slug")
@JsonPropertyDescription("Used to generate readable URL's for the Waifu")
private String slug;
/**
* Full name, in English.
*
*/
@JsonProperty("name")
@JsonPropertyDescription("Full name, in English.")
private String name;
/**
* Name in the original language ()
*
*/
@JsonProperty("original_name")
@JsonPropertyDescription("Name in the original language (\u65e5\u672c\u8a9e)")
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
*
*/
@JsonProperty("display_picture")
@JsonPropertyDescription("URL of the display picture")
private String displayPicture;
/**
* Truncated, spoiler-free description of this Waifu
*
*/
@JsonProperty("description")
@JsonPropertyDescription("Truncated, spoiler-free description of this Waifu")
private String description;
/**
* Number of likes for this Waifu
*
*/
@JsonProperty("likes")
@JsonPropertyDescription("Number of likes for this Waifu")
private Integer likes;
/**
* Number of trashes for this Waifu
*
*/
@JsonProperty("trash")
@JsonPropertyDescription("Number of trashes for this Waifu")
private Integer trash;
/**
* URL to view in browser
*
*/
@JsonProperty("url")
@JsonPropertyDescription("URL to view in browser")
private String url;
/**
* <p>{@link List<Appearance>} of Waifu's {@link Appearance}</p>
*/
@JsonProperty("appearances")
private List<Appearance> appearances;
/**
* {@link FilteredWaifu} ID
*/
@JsonProperty("id")
private Double id;
@JsonProperty("slug")
public String getSlug() {
return slug;
}
@JsonProperty("slug")
public void setSlug(String slug) {
this.slug = slug;
}
@JsonProperty("name")
public String getName() {
return name;
}
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
@JsonProperty("original_name")
public String getOriginalName() {
return originalName;
}
@JsonProperty("original_name")
public void setOriginalName(String 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")
public String getDisplayPicture() {
return displayPicture;
}
@JsonProperty("display_picture")
public void setDisplayPicture(String displayPicture) {
this.displayPicture = displayPicture;
}
@JsonProperty("description")
public String getDescription() {
return description;
}
@JsonProperty("description")
public void setDescription(String description) {
this.description = description;
}
@JsonProperty("likes")
public Integer getLikes() {
return likes;
}
@JsonProperty("likes")
public void setLikes(Integer likes) {
this.likes = likes;
}
@JsonProperty("trash")
public Integer getTrash() {
return trash;
}
@JsonProperty("trash")
public void setTrash(Integer trash) {
this.trash = trash;
}
@JsonProperty("url")
public String getUrl() {
return url;
}
@JsonProperty("url")
public void setUrl(String url) {
this.url = url;
}
@JsonProperty("appearances")
public List<Appearance> getAppearances() {
return appearances;
}
@JsonProperty("appearances")
public void setAppearances(List<Appearance> appearances) {
this.appearances = appearances;
}
@JsonProperty("id")
public Double getId() {
return id;
}
@JsonProperty("id")
public void setId(Double id) {
this.id = id;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
FilteredWaifu that = (FilteredWaifu) o;
return Objects.equals(slug, that.slug) && Objects.equals(name, that.name) && Objects.equals(originalName, that.originalName) && Objects.equals(romajiName, that.romajiName) && Objects.equals(displayPicture, that.displayPicture) && Objects.equals(description, that.description) && Objects.equals(likes, that.likes) && Objects.equals(trash, that.trash) && Objects.equals(url, that.url) && Objects.equals(appearances, that.appearances) && Objects.equals(id, that.id);
}
@Override
public int hashCode() {
return Objects.hash(slug, name, originalName, romajiName, displayPicture, description, likes, trash, url, appearances, id);
}
@Override
public String toString() {
return "FilteredWaifu{" +
"slug='" + slug + '\'' +
", name='" + name + '\'' +
", originalName='" + originalName + '\'' +
", romajiName='" + romajiName + '\'' +
", displayPicture='" + displayPicture + '\'' +
", description='" + description + '\'' +
", likes=" + likes +
", trash=" + trash +
", url='" + url + '\'' +
", appearances=" + appearances +
", id=" + id +
'}';
}
}

@ -0,0 +1,686 @@
package org.goudham.me.api.entity.waifu;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonCreator;
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;
/**
* {@link Waifu}
* <p>Contains most common attributes for {@link Waifu}'s based on various source material</p>
*
* <p> Fields included are: </p>
* <ul>
* <li>{@link Integer id}</li>
* <li>{@link String slug}</li>
* <li>{@link Integer creatorId}</li>
* <li>{@link String name}</li>
* <li>{@link String originalName}</li>
* <li>{@link String displayPicture}</li>
* <li>{@link String description}</li>
* <li>{@link Double weight}</li>
* <li>{@link Double height}</li>
* <li>{@link Double bust}</li>
* <li>{@link Double hip}</li>
* <li>{@link Double waist}</li>
* <li>{@link Waifu.BloodType bloodType}</li>
* <li>{@link String origin}</li>
* <li>{@link Integer age}</li>
* <li>{@link String birthdayMonth}</li>
* <li>{@link Integer birthdayDay}</li>
* <li>{@link Integer birthdayYear}</li>
* <li>{@link Integer likes}</li>
* <li>{@link Integer trash}</li>
* <li>{@link String url}</li>
* <li>{@link Boolean husbando}</li>
* <li>{@link Boolean nsfw}</li>
* <li>{@link Integer popularityRank}</li>
* <li>{@link Integer likeRank}</li>
* <li>{@link Integer trashRank}</li>
* <li>{@link List} of {@link Appearance}'s</li>
* <li>{@link Series series}</li>
* </ul>
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"id",
"slug",
"creator_id",
"name",
"original_name",
"display_picture",
"description",
"weight",
"height",
"bust",
"hip",
"waist",
"blood_type",
"origin",
"age",
"birthday_month",
"birthday_day",
"birthday_year",
"likes",
"trash",
"url",
"husbando",
"nsfw",
"popularity_rank",
"like_rank",
"trash_rank",
"appearances",
"series"
})
@Generated("jsonschema2pojo")
public class Waifu {
/**
* {@link Waifu} ID
*
*/
@JsonProperty("id")
@JsonPropertyDescription("ID of this Waifu")
private Integer id;
/**
* Used to generate readable URL's for the {@link Waifu}
*
*/
@JsonProperty("slug")
@JsonPropertyDescription("Used to generate readable URL's for the Waifu")
private String slug;
/**
* ID of the user who created this {@link Waifu}
*
*/
@JsonProperty("creator_id")
@JsonPropertyDescription("ID of the user who created this Waifu")
private Integer creatorId;
/**
* Full name, in English.
*
*/
@JsonProperty("name")
@JsonPropertyDescription("Full name, in English.")
private String name;
/**
* Name in the original language ()
*
*/
@JsonProperty("original_name")
@JsonPropertyDescription("Name in the original language (\u65e5\u672c\u8a9e)")
private String originalName;
/**
* URL of the display picture
*
*/
@JsonProperty("display_picture")
@JsonPropertyDescription("URL of the display picture")
private String displayPicture;
/**
* Spoiler-free description of this {@link Waifu}
*
*/
@JsonProperty("description")
@JsonPropertyDescription("Spoiler-free description of this Waifu")
private String description;
/**
* Weight (kg)
*
*/
@JsonProperty("weight")
@JsonPropertyDescription("Weight (kg)")
private Double weight;
/**
* Height(cm)
*
*/
@JsonProperty("height")
@JsonPropertyDescription("Height(cm)")
private Double height;
/**
* Bust size (cm)
*
*/
@JsonProperty("bust")
@JsonPropertyDescription("Bust size (cm)")
private Double bust;
/**
* Hip size (cm)
*
*/
@JsonProperty("hip")
@JsonPropertyDescription("Hip size (cm)")
private Double hip;
/**
* Waist size (cm)
*
*/
@JsonProperty("waist")
@JsonPropertyDescription("Waist size (cm)")
private Double waist;
/**
* Common in Japanese culture as a potential reprenstation of personality types
*
*/
@JsonProperty("blood_type")
@JsonPropertyDescription("Common in Japanese culture as a potential reprenstation of personality types")
private Waifu.BloodType bloodType;
/**
* Birth location, home, etc.
*
*/
@JsonProperty("origin")
@JsonPropertyDescription("Birth location, home, etc.")
private String origin;
/**
* Age from the source material (e.g. 500 for 500 years old)
*
*/
@JsonProperty("age")
@JsonPropertyDescription("Age from the source material (e.g. 500 for 500 years old)")
private Integer age;
/**
* Birth month from source material
*
*/
@JsonProperty("birthday_month")
@JsonPropertyDescription("Birth month from source material")
private String birthdayMonth;
/**
* Birth day from source material
*
*/
@JsonProperty("birthday_day")
@JsonPropertyDescription("Birth day from source material")
private Integer birthdayDay;
/**
* Birth year from source material
*
*/
@JsonProperty("birthday_year")
@JsonPropertyDescription("Birth year from source material")
private Integer birthdayYear;
/**
* Number of likes for this {@link Waifu}
*
*/
@JsonProperty("likes")
@JsonPropertyDescription("Number of likes for this Waifu")
private Integer likes;
/**
* Number of trashes for this {@link Waifu}
*
*/
@JsonProperty("trash")
@JsonPropertyDescription("Number of trashes for this Waifu")
private Integer trash;
/**
* URL to view in browser
*
*/
@JsonProperty("url")
@JsonPropertyDescription("URL to view in browser")
private String url;
/**
* If this character is a husbando
*
*/
@JsonProperty("husbando")
@JsonPropertyDescription("If this character is a husbando")
private Boolean husbando;
/**
* If this {@link Waifu}\husbando appears in an NSFW work
*
*/
@JsonProperty("nsfw")
@JsonPropertyDescription("If this waifu\\husbando appears in an NSFW work")
private Boolean nsfw;
/**
* Site-wide popularity ranking
*
*/
@JsonProperty("popularity_rank")
@JsonPropertyDescription("Site-wide popularity ranking")
private Integer popularityRank;
/**
* Site-wide "like" or "claim" ranking
*
*/
@JsonProperty("like_rank")
@JsonPropertyDescription("Site-wide \"like\" or \"claim\" ranking")
private Integer likeRank;
/**
* Site-wide trash ranking - lower is worse.
*
*/
@JsonProperty("trash_rank")
@JsonPropertyDescription("Site-wide trash ranking - lower is worse")
private Integer trashRank;
/**
* An array of series or works that this character appears in.
*
*/
@JsonProperty("appearances")
@JsonPropertyDescription("An array of series or works that this character appears in")
private List<Appearance> appearances = null;
/**
* {@link Series}
* <p>Contains basic series information for most endpoints</p>
*
*/
@JsonProperty("series")
@JsonPropertyDescription("Contains basic series information for most endpoints")
private Series series;
@JsonProperty("id")
public Integer getId() {
return id;
}
@JsonProperty("id")
public void setId(Integer id) {
this.id = id;
}
@JsonProperty("slug")
public String getSlug() {
return slug;
}
@JsonProperty("slug")
public void setSlug(String slug) {
this.slug = slug;
}
@JsonProperty("creator_id")
public Integer getCreatorId() {
return creatorId;
}
@JsonProperty("creator_id")
public void setCreatorId(Integer creatorId) {
this.creatorId = creatorId;
}
@JsonProperty("name")
public String getName() {
return name;
}
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
@JsonProperty("original_name")
public String getOriginalName() {
return originalName;
}
@JsonProperty("original_name")
public void setOriginalName(String originalName) {
this.originalName = originalName;
}
@JsonProperty("display_picture")
public String getDisplayPicture() {
return displayPicture;
}
@JsonProperty("display_picture")
public void setDisplayPicture(String displayPicture) {
this.displayPicture = displayPicture;
}
@JsonProperty("description")
public String getDescription() {
return description;
}
@JsonProperty("description")
public void setDescription(String description) {
this.description = description;
}
@JsonProperty("weight")
public Double getWeight() {
return weight;
}
@JsonProperty("weight")
public void setWeight(Double weight) {
this.weight = weight;
}
@JsonProperty("height")
public Double getHeight() {
return height;
}
@JsonProperty("height")
public void setHeight(Double height) {
this.height = height;
}
@JsonProperty("bust")
public Double getBust() {
return bust;
}
@JsonProperty("bust")
public void setBust(Double bust) {
this.bust = bust;
}
@JsonProperty("hip")
public Double getHip() {
return hip;
}
@JsonProperty("hip")
public void setHip(Double hip) {
this.hip = hip;
}
@JsonProperty("waist")
public Double getWaist() {
return waist;
}
@JsonProperty("waist")
public void setWaist(Double waist) {
this.waist = waist;
}
@JsonProperty("blood_type")
public Waifu.BloodType getBloodType() {
return bloodType;
}
@JsonProperty("blood_type")
public void setBloodType(Waifu.BloodType bloodType) {
this.bloodType = bloodType;
}
@JsonProperty("origin")
public String getOrigin() {
return origin;
}
@JsonProperty("origin")
public void setOrigin(String origin) {
this.origin = origin;
}
@JsonProperty("age")
public Integer getAge() {
return age;
}
@JsonProperty("age")
public void setAge(Integer age) {
this.age = age;
}
@JsonProperty("birthday_month")
public String getBirthdayMonth() {
return birthdayMonth;
}
@JsonProperty("birthday_month")
public void setBirthdayMonth(String birthdayMonth) {
this.birthdayMonth = birthdayMonth;
}
@JsonProperty("birthday_day")
public Integer getBirthdayDay() {
return birthdayDay;
}
@JsonProperty("birthday_day")
public void setBirthdayDay(Integer birthdayDay) {
this.birthdayDay = birthdayDay;
}
@JsonProperty("birthday_year")
public Integer getBirthdayYear() {
return birthdayYear;
}
@JsonProperty("birthday_year")
public void setBirthdayYear(Integer birthdayYear) {
this.birthdayYear = birthdayYear;
}
@JsonProperty("likes")
public Integer getLikes() {
return likes;
}
@JsonProperty("likes")
public void setLikes(Integer likes) {
this.likes = likes;
}
@JsonProperty("trash")
public Integer getTrash() {
return trash;
}
@JsonProperty("trash")
public void setTrash(Integer trash) {
this.trash = trash;
}
@JsonProperty("url")
public String getUrl() {
return url;
}
@JsonProperty("url")
public void setUrl(String url) {
this.url = url;
}
@JsonProperty("husbando")
public Boolean getHusbando() {
return husbando;
}
@JsonProperty("husbando")
public void setHusbando(Boolean husbando) {
this.husbando = husbando;
}
@JsonProperty("nsfw")
public Boolean getNsfw() {
return nsfw;
}
@JsonProperty("nsfw")
public void setNsfw(Boolean nsfw) {
this.nsfw = nsfw;
}
@JsonProperty("popularity_rank")
public Integer getPopularityRank() {
return popularityRank;
}
@JsonProperty("popularity_rank")
public void setPopularityRank(Integer popularityRank) {
this.popularityRank = popularityRank;
}
@JsonProperty("like_rank")
public Integer getLikeRank() {
return likeRank;
}
@JsonProperty("like_rank")
public void setLikeRank(Integer likeRank) {
this.likeRank = likeRank;
}
@JsonProperty("trash_rank")
public Integer getTrashRank() {
return trashRank;
}
@JsonProperty("trash_rank")
public void setTrashRank(Integer trashRank) {
this.trashRank = trashRank;
}
@JsonProperty("appearances")
public List<Appearance> getAppearances() {
return appearances;
}
@JsonProperty("appearances")
public void setAppearances(List<Appearance> appearances) {
this.appearances = appearances;
}
@JsonProperty("series")
public Series getSeries() {
return series;
}
@JsonProperty("series")
public void setSeries(Series series) {
this.series = series;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
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);
}
@Override
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);
}
@Override
public String toString() {
return "Waifu{" +
"id=" + id +
", slug='" + slug + '\'' +
", creatorId=" + creatorId +
", name='" + name + '\'' +
", originalName='" + originalName + '\'' +
", displayPicture='" + displayPicture + '\'' +
", description='" + description + '\'' +
", weight=" + weight +
", height=" + height +
", bust=" + bust +
", hip=" + hip +
", waist=" + waist +
", bloodType=" + bloodType +
", origin='" + origin + '\'' +
", age=" + age +
", birthdayMonth='" + birthdayMonth + '\'' +
", birthdayDay=" + birthdayDay +
", birthdayYear=" + birthdayYear +
", likes=" + likes +
", trash=" + trash +
", url='" + url + '\'' +
", husbando=" + husbando +
", nsfw=" + nsfw +
", popularityRank=" + popularityRank +
", likeRank=" + likeRank +
", trashRank=" + trashRank +
", appearances=" + appearances +
", series=" + series +
'}';
}
/**
* {@link BloodType}
* <p>Common in Japanese culture as a potential representation of personality types</p>
*
*/
@Generated("jsonschema2pojo")
public enum BloodType {
A("A"),
B("B"),
O("O"),
AB("AB");
private final String value;
private final static Map<String, Waifu.BloodType> CONSTANTS = new HashMap<String, Waifu.BloodType>();
static {
for (Waifu.BloodType bloodType: values()) {
CONSTANTS.put(bloodType.value, bloodType);
}
}
BloodType(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static Waifu.BloodType fromValue(String value) {
Waifu.BloodType constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
}

@ -0,0 +1,108 @@
package org.goudham.me.api.entity.waifu;
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 javax.annotation.processing.Generated;
import java.util.Objects;
/**
* {@link WaifuImage}
* <p>Contains a thumbnail and full res image link for an image in a given Waifus gallery</p>
*
* <p>Fields included are:</p>
* <ul>
* <li>{@link Integer id}</li>
* <li>{@link String thumbnail}</li>
* <li>{@link String path}</li>
* </ul>
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"id",
"thumbnail",
"path"
})
@Generated("jsonschema2pojo")
public class WaifuImage {
/**
* ID in the database
*
*/
@JsonProperty("id")
@JsonPropertyDescription("ID in the database")
private Integer id;
/**
* URL of the thumbnail to display
*
*/
@JsonProperty("thumbnail")
@JsonPropertyDescription("URL of the thumbnail to display")
private String thumbnail;
/**
* Final URL of the original resolution image
*
*/
@JsonProperty("path")
@JsonPropertyDescription("Final URL of the original resolution image")
private String path;
@JsonProperty("id")
public Integer getId() {
return id;
}
@JsonProperty("id")
public void setId(Integer id) {
this.id = id;
}
@JsonProperty("thumbnail")
public String getThumbnail() {
return thumbnail;
}
@JsonProperty("thumbnail")
public void setThumbnail(String thumbnail) {
this.thumbnail = thumbnail;
}
@JsonProperty("path")
public String getPath() {
return path;
}
@JsonProperty("path")
public void setPath(String path) {
this.path = path;
}
@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);
}
@Override
public int hashCode() {
return Objects.hash(id, thumbnail, path);
}
@Override
public String toString() {
return "WaifuImage{" +
"id=" + id +
", thumbnail='" + thumbnail + '\'' +
", path='" + path + '\'' +
'}';
}
}

@ -0,0 +1,20 @@
package org.goudham.me;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* Unit test for simple App.
*/
public class AppTest
{
/**
* Rigorous Test :-)
*/
@Test
public void shouldAnswerWithTrue()
{
assertTrue( true );
}
}
Loading…
Cancel
Save