create changelog entry
[debian/openrocket] / core / src / net / sf / openrocket / communication / UpdateInfo.java
1 package net.sf.openrocket.communication;
2
3 import java.util.List;
4
5 import net.sf.openrocket.util.ArrayList;
6 import net.sf.openrocket.util.BuildProperties;
7 import net.sf.openrocket.util.ComparablePair;
8
9 public class UpdateInfo {
10         
11         private final String latestVersion;
12         
13         private final ArrayList<ComparablePair<Integer, String>> updates;
14         
15         
16         public UpdateInfo() {
17                 this.latestVersion = BuildProperties.getVersion();
18                 this.updates = new ArrayList<ComparablePair<Integer, String>>();
19         }
20         
21         public UpdateInfo(String version, List<ComparablePair<Integer, String>> updates) {
22                 this.latestVersion = version;
23                 this.updates = new ArrayList<ComparablePair<Integer, String>>(updates);
24         }
25         
26         
27
28         /**
29          * Get the latest OpenRocket version.  If it is the current version, then the value
30          * of {@link BuildProperties#getVersion()} is returned.
31          * 
32          * @return      the latest OpenRocket version.
33          */
34         public String getLatestVersion() {
35                 return latestVersion;
36         }
37         
38         
39         /**
40          * Return a list of the new features/updates that are available.  The list has a
41          * priority for each update and a message text.  The returned list may be modified.
42          * 
43          * @return      a modifiable list of the updates.
44          */
45         public List<ComparablePair<Integer, String>> getUpdates() {
46                 return updates.clone();
47         }
48         
49         @Override
50         public String toString() {
51                 return "UpdateInfo[version=" + latestVersion + "; updates=" + updates.toString() + "]";
52         }
53         
54 }