summaryrefslogtreecommitdiff
path: root/src/main/java/files/Anime.java
blob: f6cccff65f9a83220d53a1373c0568cb0e7c2f07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
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) ? ("<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 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;
    }
}