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 Sone the image belongs to. */
33 private final Sone sone;
35 /** The key of the image. */
36 private final String key;
38 /** The creation time of the image. */
39 private final long creationTime;
41 /** The width of the image. */
42 private final int width;
44 /** The height of the image. */
45 private final int height;
47 /** The title of the image. */
50 /** The description of the image. */
51 private String description;
54 * Creates a new image.
57 * The Sone the image belongs to
59 * The key of the image
61 * The creation time of the image
63 * The width of the image
65 * The height of the image
67 public Image(Sone sone, String key, long creationTime, int width, int height) {
68 this(UUID.randomUUID().toString(), sone, key, creationTime, width, height);
72 * Creates a new image.
77 * The Sone the image belongs to
79 * The key of the image
81 * The creation time of the image
83 * The width of the image
85 * The height of the image
87 public Image(String id, Sone sone, String key, long creationTime, int width, int height) {
91 this.creationTime = creationTime;
101 * Returns the ID of this image.
103 * @return The ID of this image
105 public String getId() {
110 * Returns the Sone this image belongs to.
112 * @return The Sone this image belongs to
114 public Sone getSone() {
119 * Returns the key of this image.
121 * @return The key of this image
123 public String getKey() {
128 * Returns the creation time of this image.
130 * @return The creation time of this image (in milliseconds since 1970, Jan
133 public long getCreationTime() {
138 * Returns the width of this image.
140 * @return The width of this image (in pixels)
142 public int getWidth() {
147 * Returns the height of this image.
149 * @return The height of this image (in pixels)
151 public int getHeight() {
156 * Returns the title of this image.
158 * @return The title of this image
160 public String getTitle() {
165 * Sets the title of this image.
168 * The title of this image
171 public Image setTitle(String title) {
177 * Returns the description of this image.
179 * @return The description of this image
181 public String getDescription() {
186 * Sets the description of this image.
189 * The description of this image
192 public Image setDescription(String description) {
193 this.description = description;