diff --git a/src/main/java/me/goudham/domain/pagination/Links.java b/src/main/java/me/goudham/domain/pagination/Links.java new file mode 100644 index 0000000..5494764 --- /dev/null +++ b/src/main/java/me/goudham/domain/pagination/Links.java @@ -0,0 +1,125 @@ +package me.goudham.domain.pagination; + +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 Links} + *

Contains gallery API links for {@link Meta}

+ * + *

Fields included are:

+ * + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "first", + "last", + "next", + "prev" +}) +public class Links { + /** + * First page of the gallery + * + */ + @JsonProperty("first") + @JsonPropertyDescription("First page of the gallery") + private String first; + + /** + * Last page of the gallery + * + */ + @JsonProperty("last") + @JsonPropertyDescription("Last page of the gallery") + private String last; + + /** + * Next page of the gallery + * + */ + @JsonProperty("next") + @JsonPropertyDescription("Next page of the gallery") + private String next; + + /** + * Previous page of the gallery + * + */ + @JsonProperty("prev") + @JsonPropertyDescription("Previous page of the gallery") + private String prev; + + @JsonProperty("first") + public String getFirst() { + return first; + } + + @JsonProperty("first") + public void setFirst(String first) { + this.first = first; + } + + @JsonProperty("last") + public String getLast() { + return last; + } + + @JsonProperty("last") + public void setLast(String last) { + this.last = last; + } + + @JsonProperty("next") + public String getNext() { + return next; + } + + @JsonProperty("next") + public void setNext(String next) { + this.next = next; + } + + @JsonProperty("prev") + public String getPrev() { + return prev; + } + + @JsonProperty("prev") + public void setPrev(String prev) { + this.prev = prev; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Links links = (Links) o; + return Objects.equals(first, links.first) && Objects.equals(last, links.last) && Objects.equals(next, links.next) && Objects.equals(prev, links.prev); + } + + @Override + public int hashCode() { + return Objects.hash(first, last, next, prev); + } + + @Override + public String toString() { + return "Links{" + + "first='" + first + '\'' + + ", last='" + last + '\'' + + ", next='" + next + '\'' + + ", prev='" + prev + '\'' + + '}'; + } +} diff --git a/src/main/java/me/goudham/domain/pagination/PaginationData.java b/src/main/java/me/goudham/domain/pagination/PaginationData.java new file mode 100644 index 0000000..2437e4e --- /dev/null +++ b/src/main/java/me/goudham/domain/pagination/PaginationData.java @@ -0,0 +1,84 @@ +package me.goudham.domain.pagination; + +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.List; + +/** + * {@link PaginationData} + *

Contains standard Pagination data from the API including images

+ * + *

Fields included are:

+ * + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "data", + "links", + "meta" +}) +public class PaginationData { + + /** + * Data returned from the gallery + * + */ + @JsonProperty("data") + @JsonPropertyDescription("Data returned from the gallery") + private List data; + + /** + * {@link Links} to other data within the gallery + * + */ + @JsonProperty("links") + @JsonPropertyDescription("Links to other data within the gallery") + private Links links; + + /** + * Extra pagination information + * + */ + @JsonProperty("meta") + @JsonPropertyDescription("Extra pagination information") + private Meta meta; + + @JsonProperty("data") + public List getData() { + return data; + } + + @JsonProperty("data") + public void setData(List data) { + this.data = data; + } + + @JsonProperty("links") + public Links getLinks() { + return links; + } + + @JsonProperty("links") + public void setLinks(Links links) { + this.links = links; + } + + @JsonProperty("meta") + public Meta getMeta() { + return meta; + } + + @JsonProperty("meta") + public void setMeta(Meta meta) { + this.meta = meta; + } + +} \ No newline at end of file