| 1 | package be.nikiroo.fanfix.data; |
| 2 | |
| 3 | import java.awt.image.BufferedImage; |
| 4 | import java.util.List; |
| 5 | |
| 6 | /** |
| 7 | * The meta data associated to a {@link Story} object. |
| 8 | * |
| 9 | * @author niki |
| 10 | */ |
| 11 | public class MetaData { |
| 12 | private String title; |
| 13 | private String author; |
| 14 | private String date; |
| 15 | private Chapter resume; |
| 16 | private List<String> tags; |
| 17 | private BufferedImage cover; |
| 18 | private String subject; |
| 19 | private String source; |
| 20 | private String url; |
| 21 | private String uuid; |
| 22 | private String luid; |
| 23 | private String lang; |
| 24 | private String publisher; |
| 25 | private String type; |
| 26 | private boolean imageDocument; |
| 27 | |
| 28 | /** |
| 29 | * The title of the story. |
| 30 | * |
| 31 | * @return the title |
| 32 | */ |
| 33 | public String getTitle() { |
| 34 | return title; |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * The title of the story. |
| 39 | * |
| 40 | * @param title |
| 41 | * the title to set |
| 42 | */ |
| 43 | public void setTitle(String title) { |
| 44 | this.title = title; |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * The author of the story. |
| 49 | * |
| 50 | * @return the author |
| 51 | */ |
| 52 | public String getAuthor() { |
| 53 | return author; |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * The author of the story. |
| 58 | * |
| 59 | * @param author |
| 60 | * the author to set |
| 61 | */ |
| 62 | public void setAuthor(String author) { |
| 63 | this.author = author; |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * The story publication date. |
| 68 | * |
| 69 | * @return the date |
| 70 | */ |
| 71 | public String getDate() { |
| 72 | return date; |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * The story publication date. |
| 77 | * |
| 78 | * @param date |
| 79 | * the date to set |
| 80 | */ |
| 81 | public void setDate(String date) { |
| 82 | this.date = date; |
| 83 | } |
| 84 | |
| 85 | /** |
| 86 | * The tags associated with this story. |
| 87 | * |
| 88 | * @return the tags |
| 89 | */ |
| 90 | public List<String> getTags() { |
| 91 | return tags; |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * The tags associated with this story. |
| 96 | * |
| 97 | * @param tags |
| 98 | * the tags to set |
| 99 | */ |
| 100 | public void setTags(List<String> tags) { |
| 101 | this.tags = tags; |
| 102 | } |
| 103 | |
| 104 | /** |
| 105 | * The story resume (a.k.a. description). |
| 106 | * |
| 107 | * @return the resume |
| 108 | */ |
| 109 | public Chapter getResume() { |
| 110 | return resume; |
| 111 | } |
| 112 | |
| 113 | /** |
| 114 | * The story resume (a.k.a. description). |
| 115 | * |
| 116 | * @param resume |
| 117 | * the resume to set |
| 118 | */ |
| 119 | public void setResume(Chapter resume) { |
| 120 | this.resume = resume; |
| 121 | } |
| 122 | |
| 123 | /** |
| 124 | * The cover image of the story if any (can be NULL). |
| 125 | * |
| 126 | * @return the cover |
| 127 | */ |
| 128 | public BufferedImage getCover() { |
| 129 | return cover; |
| 130 | } |
| 131 | |
| 132 | /** |
| 133 | * The cover image of the story if any (can be NULL). |
| 134 | * |
| 135 | * @param cover |
| 136 | * the cover to set |
| 137 | */ |
| 138 | public void setCover(BufferedImage cover) { |
| 139 | this.cover = cover; |
| 140 | } |
| 141 | |
| 142 | /** |
| 143 | * The subject of the story (or instance, if it is a fanfiction, what is the |
| 144 | * original work; if it is a technical text, what is the technical |
| 145 | * subject...). |
| 146 | * |
| 147 | * @return the subject |
| 148 | */ |
| 149 | public String getSubject() { |
| 150 | return subject; |
| 151 | } |
| 152 | |
| 153 | /** |
| 154 | * The subject of the story (for instance, if it is a fanfiction, what is |
| 155 | * the original work; if it is a technical text, what is the technical |
| 156 | * subject...). |
| 157 | * |
| 158 | * @param subject |
| 159 | * the subject to set |
| 160 | */ |
| 161 | public void setSubject(String subject) { |
| 162 | this.subject = subject; |
| 163 | } |
| 164 | |
| 165 | /** |
| 166 | * The source of this story (which online library it was downloaded from). |
| 167 | * |
| 168 | * @return the source |
| 169 | */ |
| 170 | public String getSource() { |
| 171 | return source; |
| 172 | } |
| 173 | |
| 174 | /** |
| 175 | * The source of this story (which online library it was downloaded from). |
| 176 | * |
| 177 | * @param source |
| 178 | * the source to set |
| 179 | */ |
| 180 | public void setSource(String source) { |
| 181 | this.source = source; |
| 182 | } |
| 183 | |
| 184 | /** |
| 185 | * The original URL from which this {@link Story} was imported. |
| 186 | * |
| 187 | * @return the url |
| 188 | */ |
| 189 | public String getUrl() { |
| 190 | return url; |
| 191 | } |
| 192 | |
| 193 | /** |
| 194 | * The original URL from which this {@link Story} was imported. |
| 195 | * |
| 196 | * @param url |
| 197 | * the new url to set |
| 198 | */ |
| 199 | public void setUrl(String url) { |
| 200 | this.url = url; |
| 201 | } |
| 202 | |
| 203 | /** |
| 204 | * A unique value representing the story (it is often a URL). |
| 205 | * |
| 206 | * @return the uuid |
| 207 | */ |
| 208 | public String getUuid() { |
| 209 | return uuid; |
| 210 | } |
| 211 | |
| 212 | /** |
| 213 | * A unique value representing the story (it is often a URL). |
| 214 | * |
| 215 | * @param uuid |
| 216 | * the uuid to set |
| 217 | */ |
| 218 | public void setUuid(String uuid) { |
| 219 | this.uuid = uuid; |
| 220 | } |
| 221 | |
| 222 | /** |
| 223 | * A unique value representing the story in the local library. |
| 224 | * |
| 225 | * @return the luid |
| 226 | */ |
| 227 | public String getLuid() { |
| 228 | return luid; |
| 229 | } |
| 230 | |
| 231 | /** |
| 232 | * A unique value representing the story in the local library. |
| 233 | * |
| 234 | * @param uuid |
| 235 | * the luid to set |
| 236 | */ |
| 237 | public void setLuid(String luid) { |
| 238 | this.luid = luid; |
| 239 | } |
| 240 | |
| 241 | /** |
| 242 | * The 2-letter code language of this story. |
| 243 | * |
| 244 | * @return the lang |
| 245 | */ |
| 246 | public String getLang() { |
| 247 | return lang; |
| 248 | } |
| 249 | |
| 250 | /** |
| 251 | * The 2-letter code language of this story. |
| 252 | * |
| 253 | * @param lang |
| 254 | * the lang to set |
| 255 | */ |
| 256 | public void setLang(String lang) { |
| 257 | this.lang = lang; |
| 258 | } |
| 259 | |
| 260 | /** |
| 261 | * The story publisher (other the same as the source). |
| 262 | * |
| 263 | * @return the publisher |
| 264 | */ |
| 265 | public String getPublisher() { |
| 266 | return publisher; |
| 267 | } |
| 268 | |
| 269 | /** |
| 270 | * The story publisher (other the same as the source). |
| 271 | * |
| 272 | * @param publisher |
| 273 | * the publisher to set |
| 274 | */ |
| 275 | public void setPublisher(String publisher) { |
| 276 | this.publisher = publisher; |
| 277 | } |
| 278 | |
| 279 | /** |
| 280 | * The output type this {@link Story} is in. |
| 281 | * |
| 282 | * @return the type the type |
| 283 | */ |
| 284 | public String getType() { |
| 285 | return type; |
| 286 | } |
| 287 | |
| 288 | /** |
| 289 | * The output type this {@link Story} is in. |
| 290 | * |
| 291 | * @param type |
| 292 | * the new type to set |
| 293 | */ |
| 294 | public void setType(String type) { |
| 295 | this.type = type; |
| 296 | } |
| 297 | |
| 298 | /** |
| 299 | * Document catering mostly to image files. |
| 300 | * |
| 301 | * @return the imageDocument state |
| 302 | */ |
| 303 | public boolean isImageDocument() { |
| 304 | return imageDocument; |
| 305 | } |
| 306 | |
| 307 | /** |
| 308 | * Document catering mostly to image files. |
| 309 | * |
| 310 | * @param imageDocument |
| 311 | * the imageDocument state to set |
| 312 | */ |
| 313 | public void setImageDocument(boolean imageDocument) { |
| 314 | this.imageDocument = imageDocument; |
| 315 | } |
| 316 | } |