package fi.metropolia.yellow_spaceship.androidadvproject.models;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * A single sound from the DAM.
 */
public class DAMSound {

    private String Title;
    private String OriginalFilename;
    private SoundCategory Category;
    private SoundType SoundType;
    private int LengthSec; // TODO: Can this be a float on the DAM side?
    private Date CreationDate;
    private String FileExtension;
    private String FileSizeKB;
    private String CreatedBy;
    private String CollectionName;
    private int CollectionID;
    private String DownloadLink;
    private Map<String, Object> additionalProperties = new HashMap<String, Object>();

    /**
     * Title of the sound
     * @return The Title
     */
    public String getTitle() {
        return Title;
    }

    /**
     * @param Title The Title
     */
    public void setTitle(String Title) {
        this.Title = Title;
    }

    /**
     * Original file name
     * @return The OriginalFilename
     */
    public String getOriginalFilename() {
        return OriginalFilename;
    }

    /**
     * @param OriginalFilename The Original filename
     */
    public void setOriginalFilename(String OriginalFilename) {
        this.OriginalFilename = OriginalFilename;
    }

    /**
     * Category of the sound, e.g. NATURE, HUMAN
     * @return The Category
     */
    public SoundCategory getCategory() {
        return Category;
    }

    /**
     * @param Category The Category
     */
    public void setCategory(SoundCategory Category) {
        this.Category = Category;
    }

    /**
     * The sound's type, e.g. SOUNDSCAPE, EFFECT
     * @return The SoundType
     */
    public SoundType getSoundType() {
        return SoundType;
    }

    /**
     * @param SoundType The Sound Type
     */
    public void setSoundType(SoundType SoundType) {
        this.SoundType = SoundType;
    }

    /**
     * Length of the sound in full seconds
     * @return The LengthSec
     */
    public int getLengthSec() {
        return LengthSec;
    }

    /**
     * @param LengthSec The Length (sec)
     */
    public void setLengthSec(int LengthSec) {
        this.LengthSec = LengthSec;
    }

    /**
     * Date that the sound was created on
     * @return The CreationDate
     */
    public Date getCreationDate() {
        return CreationDate;
    }

    /**
     * @param CreationDate The Creation date
     */
    public void setCreationDate(Date CreationDate) {
        this.CreationDate = CreationDate;
    }

    /**
     * File extension, without the dot, e.g. "mp3"
     * @return The FileExtension
     */
    public String getFileExtension() {
        return FileExtension;
    }

    /**
     * @param FileExtension The File extension
     */
    public void setFileExtension(String FileExtension) {
        this.FileExtension = FileExtension;
    }

    /**
     * File size in kilobytes
     * @return The FileSizeKB
     */
    public String getFileSizeKB() {
        return FileSizeKB;
    }

    /**
     * @param FileSizeKB The File size(KB)
     */
    public void setFileSizeKB(String FileSizeKB) {
        this.FileSizeKB = FileSizeKB;
    }

    /**
     * Username of the user that created this sound
     * @return The CreatedBy
     */
    public String getCreatedBy() {
        return CreatedBy;
    }

    /**
     * @param CreatedBy The Created by
     */
    public void setCreatedBy(String CreatedBy) {
        this.CreatedBy = CreatedBy;
    }

    /**
     * Name of the collection where this sound is located
     * @return The CollectionName
     */
    public String getCollectionName() {
        return CollectionName;
    }

    /**
     * @param CollectionName The Collection name
     */
    public void setCollectionName(String CollectionName) {
        this.CollectionName = CollectionName;
    }

    /**
     * The ID of the collection where this sound is located
     * @return The CollectionID
     */
    public int getCollectionID() {
        return CollectionID;
    }

    /**
     * @param CollectionID The Collection ID
     */
    public void setCollectionID(int CollectionID) {
        this.CollectionID = CollectionID;
    }

    /**
     * URL to download the sound
     * @return Download URL
     */
    public String getDownloadLink() {
        return DownloadLink;
    }

    /**
     * @param downloadLink New download URL
     */
    public void setDownloadLink(String downloadLink) {
        DownloadLink = downloadLink;
    }

    public Map<String, Object> getAdditionalProperties() {
        return this.additionalProperties;
    }

    public void setAdditionalProperty(String name, Object value) {
        this.additionalProperties.put(name, value);
    }
}
@@ -196,16 +196,47 @@
 ound %7B%0A%0A
+    // Properties found in DAM%0A
     priv
@@ -743,16 +743,133 @@
 ct%3E();%0A%0A
+    // Additional local properties%0A    private transient boolean isFavorite;%0A    private transient String fileName;%0A%0A
     /**%0A
@@ -4916,10 +4916,740 @@
 );%0A    %7D
+%0A%0A    /**%0A     * Has the local user favorited this sound%0A     * @return Is this sound favorited%0A     */%0A    public boolean getIsFavorite() %7B%0A        return isFavorite;%0A    %7D%0A%0A    /**%0A     * Set favorite-status for this sound%0A     * @param favorite True if this is a favorite%0A     */%0A    public void setIsFavorite(boolean favorite) %7B%0A        this.isFavorite = favorite;%0A    %7D%0A%0A    /**%0A     * Get local file name%0A     * @return %7B?String%7D Returns null if file is not saved locally%0A     */%0A    public String getFileName() %7B%0A        return fileName;%0A    %7D%0A%0A    /**%0A     * Set local file name%0A     * @param fileName Local file name for sound%0A     */%0A    public void setFileName(String fileName) %7B%0A        this.fileName = fileName;%0A    %7D
 %0A%7D

Add fields for favorites, file name to DAMSound