View Javadoc

1   package org.musicontroller.importer;
2   
3   import java.io.Serializable;
4   import java.util.Date;
5   
6   import org.varienaja.util.DateTools;
7   
8   /**
9    * This bean can hold information about a playlist to be imported.
10   * The information kept is the release date and a cover art search result.
11   * 
12   * @author Hans Drexler
13   * @version $Id: PlaylistImportProperties.java,v 1.1 2010/03/16 18:55:43 varienaja Exp $
14   */
15  public class PlaylistImportProperties implements Serializable {
16  
17  	private static final long serialVersionUID = 2008032201L;
18  
19  	/**
20  	 * The playlist name of the playlist these properties belong to.
21  	 */
22  	private String _playlistName;
23  	
24  	/**
25  	 * If true, add songs in the archive to existing playlist. If false build a new playlist.
26  	 */
27  	private boolean _addToExistingPlaylist;
28  	
29  	/**
30  	 * Is a cover art search been attempted for this import?
31  	 */
32  	private boolean _coverArtSearchDone;
33  	
34  	/**
35  	 * When was the last cover art search done?
36  	 */
37  	private Date _timeOfLastCoverArtSearch;
38  	
39  	/**
40  	 * Holds the cover art of the playlist with this name.
41  	 */
42  	private transient String _coverart;
43  
44  	/**
45  	 * Holds the release date of the playlist.
46  	 */
47  	private Date _releaseDate;
48  	
49  	/**
50  	 * No arguments constructor release date 1-1-1900, no cover art search done, add to existing.
51  	 */
52  	public PlaylistImportProperties() {
53  		_releaseDate = DateTools.encodeDate(1, 1, 1900);
54  		_addToExistingPlaylist = true;
55  		_coverArtSearchDone = false;
56  	}
57  	
58  	public boolean isAddToExistingPlaylist() {
59  		return _addToExistingPlaylist;
60  	}
61  
62  	public void setAddToExistingPlaylist(boolean toExistingPlaylist) {
63  		_addToExistingPlaylist = toExistingPlaylist;
64  	}
65  
66  	/**
67  	 * Getter for the proposed cover art image.
68  	 * @return The cover art image.
69  	 */
70  	public String getCoverArt() {
71  		return _coverart;
72  	}
73  
74  	/**
75  	 * Setter for the proposed cover art image.
76  	 * @param _coverart The proposed cover art image.
77  	 */
78  	public void setCoverArt(String _coverart) {
79  		this._coverart = _coverart;
80  	}
81  
82  	/**
83  	 * Getter for the playlist name.
84  	 * @return The playlist name.
85  	 */
86  	public String getPlaylistName() {
87  		return _playlistName;
88  	}
89  
90  	/**
91  	 * Setter for the playlist name.
92  	 * @param name The playlist name.
93  	 */
94  	public void setPlaylistName(String name) {
95  		_playlistName = name;
96  	}
97  
98  	/**
99  	 * Getter for the release date.
100 	 * @return The release date.
101 	 */
102 	public Date getReleaseDate() {
103 		return _releaseDate;
104 	}
105 	
106 	/**
107 	 * Setter for the release date.
108 	 * @param releaseDate The release date.
109 	 */
110 	public void setReleaseDate(Date releaseDate) {
111 		_releaseDate = releaseDate;
112 	}
113 
114 	/**
115 	 * Returns true if a cover art search has been performed.
116 	 * @return True if a cover art search has been performed.
117 	 */
118 	public boolean isCoverArtSearchDone() {
119 		return _coverArtSearchDone;
120 	}
121 
122 	/**
123 	 * Set to true to indicate a cover art search has been done.
124 	 * @param artSearchDone Indicator of status cover art search.
125 	 */
126 	public void setCoverArtSearchDone(boolean artSearchDone) {
127 		_coverArtSearchDone = artSearchDone;
128 	}
129 
130 	/**
131 	 * Getter for the date and time the cover art search was last done.
132 	 * @return The time of the last cover art search.
133 	 */
134 	public Date getTimeOfLastCoverArtSearch() {
135 		return _timeOfLastCoverArtSearch;
136 	}
137 
138 	/**
139 	 * Setter for the date and time the cover art search was last done.
140 	 * @param ofLastCoverArtSearch Time of the last cover art search.
141 	 */
142 	public void setTimeOfLastCoverArtSearch(Date ofLastCoverArtSearch) {
143 		_timeOfLastCoverArtSearch = ofLastCoverArtSearch;
144 	}	
145 }