1
2
3
4
5
6
7 package com.atlassian.plugin;
8
9 import com.atlassian.plugin.util.JavaVersionUtils;
10 import com.atlassian.util.concurrent.CopyOnWriteMap;
11 import com.google.common.collect.ImmutableSet;
12
13 import java.util.Collections;
14 import java.util.Map;
15 import java.util.Set;
16
17 public class PluginInformation
18 {
19 private String description = "";
20 private String descriptionKey;
21 private String version = "0.0";
22 private String vendorName = "(unknown)";
23 private String vendorUrl;
24 private float maxVersion;
25 private float minVersion;
26 private Float minJavaVersion;
27 private Set<PluginPermission> permissions = ImmutableSet.of();
28 private final Map<String, String> parameters = CopyOnWriteMap.<String, String>builder().stableViews().newHashMap();
29
30 public String getDescription()
31 {
32 return description;
33 }
34
35 public void setDescription(final String description)
36 {
37 this.description = description;
38 }
39
40 public String getVersion()
41 {
42 return version;
43 }
44
45 public void setVersion(final String version)
46 {
47 this.version = version;
48 }
49
50 public void setVendorName(final String vendorName)
51 {
52 this.vendorName = vendorName;
53 }
54
55 public void setVendorUrl(final String vendorUrl)
56 {
57 this.vendorUrl = vendorUrl;
58 }
59
60 public String getVendorName()
61 {
62 return vendorName;
63 }
64
65 public String getVendorUrl()
66 {
67 return vendorUrl;
68 }
69
70
71
72
73 @Deprecated
74 public void setMaxVersion(final float maxVersion)
75 {
76 this.maxVersion = maxVersion;
77 }
78
79
80
81
82 @Deprecated
83 public void setMinVersion(final float minVersion)
84 {
85 this.minVersion = minVersion;
86 }
87
88
89
90
91 @Deprecated
92 public float getMaxVersion()
93 {
94 return maxVersion;
95 }
96
97
98
99
100 @Deprecated
101 public float getMinVersion()
102 {
103 return minVersion;
104 }
105
106 public Float getMinJavaVersion()
107 {
108 return minJavaVersion;
109 }
110
111 public void setMinJavaVersion(final Float minJavaVersion)
112 {
113 this.minJavaVersion = minJavaVersion;
114 }
115
116 public Map<String, String> getParameters()
117 {
118 return Collections.unmodifiableMap(parameters);
119 }
120
121 public Set<PluginPermission> getPermissions()
122 {
123 return permissions;
124 }
125
126 public void setPermissions(Set<PluginPermission> permissions)
127 {
128 this.permissions = ImmutableSet.copyOf(permissions);
129 }
130
131 public void addParameter(final String key, final String value)
132 {
133 parameters.put(key, value);
134 }
135
136 public boolean satisfiesMinJavaVersion()
137 {
138 return (minJavaVersion == null) || JavaVersionUtils.satisfiesMinVersion(minJavaVersion);
139 }
140
141 public void setDescriptionKey(final String descriptionKey)
142 {
143 this.descriptionKey = descriptionKey;
144 }
145
146 public String getDescriptionKey()
147 {
148 return descriptionKey;
149 }
150 }