aboutsummaryrefslogtreecommitdiff
path: root/AudioBook.java
blob: a4888bf1d976bceec63237d11c2355bf60fc5b1d (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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
 * Name 	: AudioBook
 *
 * Description 	: The AudioBook class is used to create audiobooks while extending MusicalElement
 *
 * Version 	: 1.0
 *
 * Date 	: 28/12/2020
 *
 * Copyright 	: Aimeric ADJUTOR
 */

/**
 * The AudioBook class is used to create audiobooks while extending MusicalElement.
 *
 * @version 	1.0
 *
 * @see 	MusicalElement
 * @author 	Aimeric ADJUTOR
 */
public class AudioBook extends MusicalElement {

	private static final long serialVersionUID = -7145972304319088676L;

	private String author, language, category;

/**
 * Constructor method.
 *
 * @param 	title String
 * @param 	duration int
 * @param 	content String, path to the mp3 file
 * @param 	author String
 * @param 	language Language
 * @param 	category Category
 *
 * @see 	Language
 * @see 	Category
 *
 * @author 	Aimeric ADJUTOR
 * */
	public AudioBook(String title, int duration, String content, String author, Language language, Category category) {
		super(title, duration, content);
		this.author=author;
		this.language=language.name();
		this.category=category.name();
	}

/**
 * This method is used to give the author of the audiobook.
 *
 * @return 	It returns the author, which is a String
 *
 * @author 	Aimeric ADJUTOR
 * */
	public String getAuthor(){return author;}

/**
 * This method is used to give the language of the audiobook.
 *
 * @return 	It returns the language, which is a String because the constructor use the name method of the Language class.
 *
 * @see 	Language
 * @author 	Aimeric ADJUTOR
 * */
	public String getLanguage(){return language;}

/**
 * This method is used to give the category of the audiobook.
 *
 * @return 	It returns the category, which is a String because the constructor use the name method of the Category class.
 *
 * @see 	Category
 * @author 	Aimeric ADJUTOR
 * */
	public String getCategory(){return category;}

/**
 * Basic method to set the author of the audiobook.
 *
 * @param author String
 *
 * @author 	Aimeric ADJUTOR
 * */
	public void setArtist(String author){this.author=author;}

/**
 * Basic method to set the language of the audiobook using the name method from the Language class.
 *
 * @param language Language
 *
 * @see Language
 *
 * @author 	Aimeric ADJUTOR
 * */
	public void setGenre(Language language){this.language=language.name();}

/**
 * Basic method to set the category of the audiobook using the name method from the Category class.
 *
 * @param category Category
 *
 * @author 	Aimeric ADJUTOR
 * */
	public void setCategory(Category category){this.category=category.name();}

/**
 * Basic method to "configure" what does a print of this object actually does.
 *
 * @return 	String, using the object's methods
 *
 * @author 	Aimeric ADJUTOR
 * */
public String toString() {
		return "Id : "+getId()+"\nTitle : "+getTitle()+"\nDuration : "+getDuration()+"\nContent : "+getContent()+"\nAuthor : "+getAuthor()+"\nLanguage : "+getLanguage()+"\nCategory : "+getCategory();
}

}