diff options
Diffstat (limited to 'src/main/java/com/mavlushechka/animarfo/anime')
-rw-r--r-- | src/main/java/com/mavlushechka/animarfo/anime/Anime.java | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/src/main/java/com/mavlushechka/animarfo/anime/Anime.java b/src/main/java/com/mavlushechka/animarfo/anime/Anime.java new file mode 100644 index 0000000..89568b3 --- /dev/null +++ b/src/main/java/com/mavlushechka/animarfo/anime/Anime.java @@ -0,0 +1,90 @@ +package com.mavlushechka.animarfo.anime; + +public class Anime { + private final String name; + private final String description; + private final String genres; + private final String year; + private String series; + private final String rating; + public final String image; + private final String url; + public static String dub; + public static String type; + public static Anime[] list; + public static byte index = 0; + public static String searched; + public static byte size; + public static boolean isSearching; + + public Anime(String name, String description, String genres, String year, String series, String rating, String image, String url) { + this.name = name; + this.description = description; + this.genres = genres; + this.year = year; + this.series = series; + this.rating = rating; + this.image = image; + this.url = url; + } + + public String showInfo() { + return getName() + getYear() + getGenres() + getSeries() + getRating() + getDub() + getDescription(); + } + + public String getName() { + return (name != null) ? ("<b>Название:</b> " + this.name + System.lineSeparator()) : ""; + } + + public String getYear() { + return (year != null) ? ("<b>Год:</b> " + this.year + System.lineSeparator()) : ""; + } + + public String getGenres() { + return (genres != null) ? ("<b>Жанр:</b> " + this.genres + System.lineSeparator()) : ""; + } + + public String getSeries() { + return (series != null) ? ("<b>Серий:</b> " + this.series + System.lineSeparator()) : ""; + } + + public String getRating() { + return (rating != null) ? ("<b>Рейтинг:</b> " + this.rating + System.lineSeparator()) : ""; + } + + public String getDub() { + return (dub != null) ? ("<b>Озвучка:</b> " + dub + System.lineSeparator()) : ""; + } + + public String getDescription() { + return (description != null) ? ("<b>Описание:</b> " + description + System.lineSeparator()) : ""; + } + + public String getImage() { + return image; + } + + public String getUrl() { + return this.url; + } + + public static void setIndex(byte index) { + Anime.index = index; + } + + public static void decreaseIndexOfAnime() { + index--; + } + + public static void increaseIndexOfAnime() { + index++; + } + + public static void setSearched(String searched) { + Anime.searched = searched.replace(' ', '+'); + } + + public static void setList(Anime[] list) { + Anime.list = list; + } +} |