X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Frhynodge%2Fstates%2FComicState.java;h=7e806860a563373ecdb5fbf288c4efafea92b11b;hb=e426b888068677738269eb378c24a6f62db3614d;hp=ffc38b56221d87dc35ed7b4bec028889bb1042fd;hpb=e371f97ebb6eaa268326bfc678013dfc96378918;p=rhynodge.git diff --git a/src/main/java/net/pterodactylus/rhynodge/states/ComicState.java b/src/main/java/net/pterodactylus/rhynodge/states/ComicState.java index ffc38b5..7e80686 100644 --- a/src/main/java/net/pterodactylus/rhynodge/states/ComicState.java +++ b/src/main/java/net/pterodactylus/rhynodge/states/ComicState.java @@ -33,44 +33,28 @@ import com.google.common.collect.Lists; */ public class ComicState extends AbstractState implements Iterable { - /** The comics in this state. */ @JsonProperty private final List comics = Lists.newArrayList(); - /** - * Returns the list of comics contained in this state. - * - * @return The list of comics in this state - */ + @Override + public boolean isEmpty() { + return comics.isEmpty(); + } + public List comics() { return comics; } - /** - * Adds the given comic to this state. - * - * @param comic - * The comic to add - * @return This comic state - */ public ComicState add(Comic comic) { comics.add(comic); return this; } - // - // ITERABLE METHODS - // - @Override public Iterator iterator() { return comics.iterator(); } - // - // OBJECT METHODS - // - @Override public String toString() { return String.format("ComicState[comics=%s]", comics()); @@ -83,67 +67,34 @@ public class ComicState extends AbstractState implements Iterable { */ public static class Comic implements Iterable { - /** The title of the comic. */ @JsonProperty private final String title; - /** The strips of the comic. */ @JsonProperty private final List strips = Lists.newArrayList(); - /** - * Creates a new comic with the given title. - * - * @param title - * The title of the comic - */ public Comic(@JsonProperty("title") String title) { this.title = title; } - /** - * Returns the title of this comic. - * - * @return The title of this comic - */ public String title() { return title; } - /** - * Returns the strips of this comic. - * - * @return The strips of this comic - */ public List strips() { return strips; } - /** - * Adds a strip to this comic. - * - * @param strip - * The strip to add - * @return This comic - */ public Comic add(Strip strip) { strips.add(strip); return this; } - // - // ITERABLE METHODS - // - @Override public Iterator iterator() { return strips.iterator(); } - // - // OBJECT METHODS - // - @Override public int hashCode() { return title.hashCode() ^ strips().hashCode(); @@ -172,49 +123,25 @@ public class ComicState extends AbstractState implements Iterable { */ public static class Strip { - /** The URL of the image. */ @JsonProperty private final String imageUrl; - /** The comment of the image. */ @JsonProperty private final String comment; - /** - * Creates a new strip. - * - * @param imageUrl - * The URL of the image - * @param comment - * The comment of the image - */ public Strip(@JsonProperty("imageUrl") String imageUrl, @JsonProperty("comment") String comment) { this.imageUrl = imageUrl; this.comment = comment; } - /** - * Returns the URL of the image. - * - * @return The URL of the image - */ public String imageUrl() { return imageUrl; } - /** - * Returns the comment of the image. - * - * @return The comment of the image - */ public String comment() { return comment; } - // - // OBJECT METHODS - // - @Override public int hashCode() { return imageUrl().hashCode() ^ comment().hashCode();