2 * Sone - Image.java - Copyright © 2011 David Roden
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 package net.pterodactylus.sone.data;
20 import java.util.UUID;
23 * Container for image metadata.
25 * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
29 /** The ID of the image. */
30 private final String id;
32 /** The key of the image. */
33 private final String key;
35 /** The creation time of the image. */
36 private final long creationTime;
38 /** The width of the image. */
39 private final int width;
41 /** The height of the image. */
42 private final int height;
44 /** The title of the image. */
47 /** The description of the image. */
48 private String description;
51 * Creates a new image.
54 * The key of the image
56 * The creation time of the image
58 * The width of the image
60 * The height of the image
62 public Image(String key, long creationTime, int width, int height) {
63 this(UUID.randomUUID().toString(), key, creationTime, width, height);
67 * Creates a new image.
72 * The key of the image
74 * The creation time of the image
76 * The width of the image
78 * The height of the image
80 public Image(String id, String key, long creationTime, int width, int height) {
83 this.creationTime = creationTime;
93 * Returns the ID of this image.
95 * @return The ID of this image
97 public String getId() {
102 * Returns the key of this image.
104 * @return The key of this image
106 public String getKey() {
111 * Returns the creation time of this image.
113 * @return The creation time of this image (in milliseconds since 1970, Jan
116 public long getCreationTime() {
121 * Returns the width of this image.
123 * @return The width of this image (in pixels)
125 public int getWidth() {
130 * Returns the height of this image.
132 * @return The height of this image (in pixels)
134 public int getHeight() {
139 * Returns the title of this image.
141 * @return The title of this image
143 public String getTitle() {
148 * Sets the title of this image.
151 * The title of this image
154 public Image setTitle(String title) {
160 * Returns the description of this image.
162 * @return The description of this image
164 public String getDescription() {
169 * Sets the description of this image.
172 * The description of this image
175 public Image setDescription(String description) {
176 this.description = description;