/* * 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(); } }