2e7b341c114b88ba0d38da33a1cf8e5cddafb2aa
[Sone.git] / src / main / java / net / pterodactylus / sone / core / event / UpdateFoundEvent.java
1 /*
2  * Sone - UpdateFoundEvent.java - Copyright © 2013 David Roden
3  *
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.
8  *
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.
13  *
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/>.
16  */
17
18 package net.pterodactylus.sone.core.event;
19
20 import net.pterodactylus.util.version.Version;
21
22 /**
23  * Event that signals that an update for Sone was found.
24  *
25  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
26  */
27 public class UpdateFoundEvent {
28
29         /** The version that was found. */
30         private final Version version;
31
32         /** The time the update was released. */
33         private final long releaseTime;
34
35         /** The latest edition of the update page. */
36         private final long latestEdition;
37
38         /**
39          * Creates a new “update found” event.
40          *
41          * @param version
42          *            The version of the update
43          * @param releaseTime
44          *            The release time of the update
45          * @param latestEdition
46          *            The latest edition of the update page
47          */
48         public UpdateFoundEvent(Version version, long releaseTime, long latestEdition) {
49                 this.version = version;
50                 this.releaseTime = releaseTime;
51                 this.latestEdition = latestEdition;
52         }
53
54         //
55         // ACCESSORS
56         //
57
58         /**
59          * Returns the version of the update.
60          *
61          * @return The version of the update
62          */
63         public Version version() {
64                 return version;
65         }
66
67         /**
68          * Returns the release time of the update.
69          *
70          * @return The releae time of the update (in milliseconds since Jan 1, 1970
71          *         UTC)
72          */
73         public long releaseTime() {
74                 return releaseTime;
75         }
76
77         /**
78          * Returns the latest edition of the update page.
79          *
80          * @return The latest edition of the update page
81          */
82         public long latestEdition() {
83                 return latestEdition;
84         }
85
86 }