package files; 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 typeOfAnime; public static Anime[] list; public static byte indexOfAnime = 0; public static String searchedAnime; public static byte size; public static boolean isSearching; public Anime(String name, String description, String genres, String year, String rating, String image, String url) { this.name = name; this.description = description; this.genres = genres; this.year = year; this.rating = rating; this.image = image; this.url = url; } 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) ? ("Название: " + this.name + System.lineSeparator()) : ""; } public String getYear() { return (year != null) ? ("Год: " + this.year + System.lineSeparator()) : ""; } public String getGenres() { return (genres != null) ? ("Жанр: " + this.genres + System.lineSeparator()) : ""; } public String getSeries() { return (series != null) ? ("Серий: " + this.series + System.lineSeparator()) : ""; } public String getRating() { return (rating != null) ? ("Рейтинг: " + this.rating + System.lineSeparator()) : ""; } public String getDub() { return (dub != null) ? ("Озвучка: " + dub + System.lineSeparator()) : ""; } public String getDescription() { return (description != null) ? ("Описание: " + description + System.lineSeparator()) : ""; } public String getImage() { return image; } public String getUrl() { return this.url; } public static void setIndexOfAnime(byte indexOfAnime) { Anime.indexOfAnime = indexOfAnime; } public static void decreaseIndexOfAnime() { indexOfAnime--; } public static void increaseIndexOfAnime() { indexOfAnime++; } public static void setSearchedAnime(String searchedAnime) { Anime.searchedAnime = searchedAnime.replace(' ', '+'); } public static void setList(Anime[] list) { Anime.list = list; } }