Showing
31 changed files
with
551 additions
and
682 deletions
... | ... | @@ -4,12 +4,9 @@ import pl.itcrowd.youtrack.api.defaults.Fields; |
4 | 4 | import pl.itcrowd.youtrack.api.defaults.StateValues; |
5 | 5 | |
6 | 6 | public class Command { |
7 | -// ------------------------------ FIELDS ------------------------------ | |
8 | 7 | |
9 | 8 | protected StringBuilder command = new StringBuilder(); |
10 | 9 | |
11 | -// -------------------------- STATIC METHODS -------------------------- | |
12 | - | |
13 | 10 | public static Command assigneeCommand(String assignee) |
14 | 11 | { |
15 | 12 | return new Command().assignee(assignee); |
... | ... | @@ -25,22 +22,16 @@ public class Command { |
25 | 22 | return new Command().state(state); |
26 | 23 | } |
27 | 24 | |
28 | -// --------------------------- CONSTRUCTORS --------------------------- | |
29 | - | |
30 | 25 | protected Command() |
31 | 26 | { |
32 | 27 | } |
33 | 28 | |
34 | -// ------------------------ CANONICAL METHODS ------------------------ | |
35 | - | |
36 | 29 | @Override |
37 | 30 | public String toString() |
38 | 31 | { |
39 | 32 | return command.toString().trim(); |
40 | 33 | } |
41 | 34 | |
42 | -// -------------------------- OTHER METHODS -------------------------- | |
43 | - | |
44 | 35 | public Command assignee(String assignee) |
45 | 36 | { |
46 | 37 | return command(Fields.assignee, assignee); | ... | ... |
... | ... | @@ -12,7 +12,6 @@ import java.io.StringReader; |
12 | 12 | |
13 | 13 | //TODO methods from this class should be probably merged with YoutrackUnmarshaller |
14 | 14 | public final class ErrorUnmarshaller { |
15 | -// -------------------------- STATIC METHODS -------------------------- | |
16 | 15 | |
17 | 16 | public static String unmarshal(String string) throws JAXBException, IOException |
18 | 17 | { |
... | ... | @@ -34,8 +33,6 @@ public final class ErrorUnmarshaller { |
34 | 33 | } |
35 | 34 | } |
36 | 35 | |
37 | -// --------------------------- CONSTRUCTORS --------------------------- | |
38 | - | |
39 | 36 | private ErrorUnmarshaller() |
40 | 37 | { |
41 | 38 | } | ... | ... |
... | ... | @@ -8,7 +8,6 @@ import java.util.ArrayList; |
8 | 8 | import java.util.List; |
9 | 9 | |
10 | 10 | public final class Filter { |
11 | -// ------------------------------ FIELDS ------------------------------ | |
12 | 11 | |
13 | 12 | private long after; |
14 | 13 | |
... | ... | @@ -16,8 +15,6 @@ public final class Filter { |
16 | 15 | |
17 | 16 | private long maxResults; |
18 | 17 | |
19 | -// -------------------------- STATIC METHODS -------------------------- | |
20 | - | |
21 | 18 | public static Filter createdFilter(String date) |
22 | 19 | { |
23 | 20 | return new Filter().created(date); |
... | ... | @@ -93,15 +90,11 @@ public final class Filter { |
93 | 90 | return new Filter().updater(updater); |
94 | 91 | } |
95 | 92 | |
96 | -// --------------------------- CONSTRUCTORS --------------------------- | |
97 | - | |
98 | 93 | private Filter() |
99 | 94 | { |
100 | 95 | |
101 | 96 | } |
102 | 97 | |
103 | -// ------------------------ CANONICAL METHODS ------------------------ | |
104 | - | |
105 | 98 | @Override |
106 | 99 | public String toString() |
107 | 100 | { |
... | ... | @@ -124,8 +117,6 @@ public final class Filter { |
124 | 117 | return builder.length() > space.length() ? builder.substring(space.length()) : builder.toString(); |
125 | 118 | } |
126 | 119 | |
127 | -// -------------------------- OTHER METHODS -------------------------- | |
128 | - | |
129 | 120 | public Filter after(long after) |
130 | 121 | { |
131 | 122 | this.after = after; |
... | ... | @@ -235,17 +226,12 @@ public final class Filter { |
235 | 226 | return this; |
236 | 227 | } |
237 | 228 | |
238 | -// -------------------------- INNER CLASSES -------------------------- | |
239 | - | |
240 | 229 | private class Condition { |
241 | -// ------------------------------ FIELDS ------------------------------ | |
242 | 230 | |
243 | 231 | private Fields field; |
244 | 232 | |
245 | 233 | private String value; |
246 | 234 | |
247 | -// --------------------------- CONSTRUCTORS --------------------------- | |
248 | - | |
249 | 235 | private Condition(Fields field, String value) |
250 | 236 | { |
251 | 237 | this.field = field; | ... | ... |
... | ... | @@ -15,7 +15,6 @@ import java.util.List; |
15 | 15 | import java.util.Map; |
16 | 16 | |
17 | 17 | public class IssueWrapper implements Serializable { |
18 | -// ------------------------------ FIELDS ------------------------------ | |
19 | 18 | |
20 | 19 | private static final Log log = LogFactory.getLog(IssueWrapper.class); |
21 | 20 | |
... | ... | @@ -25,8 +24,6 @@ public class IssueWrapper implements Serializable { |
25 | 24 | |
26 | 25 | private Issue issue; |
27 | 26 | |
28 | -// --------------------------- CONSTRUCTORS --------------------------- | |
29 | - | |
30 | 27 | public IssueWrapper(Issue issue) |
31 | 28 | { |
32 | 29 | this.issue = issue; |
... | ... | @@ -44,8 +41,6 @@ public class IssueWrapper implements Serializable { |
44 | 41 | } |
45 | 42 | } |
46 | 43 | |
47 | -// -------------------------- OTHER METHODS -------------------------- | |
48 | - | |
49 | 44 | public List<Comment> getComments() |
50 | 45 | { |
51 | 46 | return Collections.unmodifiableList(comments); | ... | ... |
... | ... | @@ -64,326 +64,318 @@ import java.util.regex.Pattern; |
64 | 64 | import static pl.itcrowd.youtrack.api.URIUtils.buildURI; |
65 | 65 | |
66 | 66 | public class YoutrackAPI { |
67 | -// ------------------------------ FIELDS ------------------------------ | |
68 | 67 | |
69 | - private final static QName Enumeration_QNAME = new QName("", "enumeration"); | |
68 | + private final static QName Enumeration_QNAME = new QName("", "enumeration"); | |
70 | 69 | |
71 | - private final static QName Issue_QNAME = new QName("", "issue"); | |
70 | + private final static QName Issue_QNAME = new QName("", "issue"); | |
72 | 71 | |
73 | - private static Log LOG = LogFactory.getLog(YoutrackAPI.class); | |
72 | + private static Log LOG = LogFactory.getLog(YoutrackAPI.class); | |
74 | 73 | |
75 | - private HttpClient httpClient; | |
74 | + private HttpClient httpClient; | |
76 | 75 | |
77 | - private String serviceLocation; | |
76 | + private String serviceLocation; | |
78 | 77 | |
79 | - private URI serviceLocationURI; | |
78 | + private URI serviceLocationURI; | |
80 | 79 | |
81 | -// -------------------------- STATIC METHODS -------------------------- | |
80 | + private static HttpClient getDefaultHttpClient() | |
81 | + { | |
82 | + SSLContext sslContext; | |
83 | + try { | |
84 | + sslContext = SSLContext.getInstance("SSL"); | |
85 | + } catch (NoSuchAlgorithmException e) { | |
86 | + throw new RuntimeException(e); | |
87 | + } | |
88 | + // set up a TrustManager that trusts everything | |
89 | + try { | |
90 | + sslContext.init(null, new TrustManager[]{new X509TrustManager() { | |
91 | + public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException | |
92 | + { | |
93 | + } | |
94 | + | |
95 | + public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException | |
96 | + { | |
97 | + } | |
98 | + | |
99 | + public X509Certificate[] getAcceptedIssuers() | |
100 | + { | |
101 | + return new X509Certificate[0]; | |
102 | + } | |
103 | + }}, new SecureRandom()); | |
104 | + } catch (KeyManagementException e) { | |
105 | + throw new RuntimeException(e); | |
106 | + } | |
107 | + | |
108 | + SSLSocketFactory sf = new SSLSocketFactory(sslContext); | |
109 | + Scheme httpsScheme = new Scheme("https", 443, sf); | |
110 | + SchemeRegistry schemeRegistry = SchemeRegistryFactory.createDefault(); | |
111 | + schemeRegistry.register(schemeRegistry.unregister("https")); | |
112 | + schemeRegistry.register(httpsScheme); | |
82 | 113 | |
83 | - private static HttpClient getDefaultHttpClient() | |
84 | - { | |
85 | - SSLContext sslContext; | |
86 | - try { | |
87 | - sslContext = SSLContext.getInstance("SSL"); | |
88 | - } catch (NoSuchAlgorithmException e) { | |
89 | - throw new RuntimeException(e); | |
114 | + ClientConnectionManager cm = new PoolingClientConnectionManager(schemeRegistry); | |
115 | + return new DefaultHttpClient(cm); | |
90 | 116 | } |
91 | - // set up a TrustManager that trusts everything | |
92 | - try { | |
93 | - sslContext.init(null, new TrustManager[]{new X509TrustManager() { | |
94 | - public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException | |
95 | - { | |
96 | - } | |
97 | 117 | |
98 | - public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException | |
99 | - { | |
118 | + private static boolean isBlank(String str) | |
119 | + { | |
120 | + int strLen; | |
121 | + if (str == null || (strLen = str.length()) == 0) { | |
122 | + return true; | |
100 | 123 | } |
101 | - | |
102 | - public X509Certificate[] getAcceptedIssuers() | |
103 | - { | |
104 | - return new X509Certificate[0]; | |
124 | + for (int i = 0; i < strLen; i++) { | |
125 | + if ((!Character.isWhitespace(str.charAt(i)))) { | |
126 | + return false; | |
127 | + } | |
105 | 128 | } |
106 | - }}, new SecureRandom()); | |
107 | - } catch (KeyManagementException e) { | |
108 | - throw new RuntimeException(e); | |
129 | + return true; | |
109 | 130 | } |
110 | 131 | |
111 | - SSLSocketFactory sf = new SSLSocketFactory(sslContext); | |
112 | - Scheme httpsScheme = new Scheme("https", 443, sf); | |
113 | - SchemeRegistry schemeRegistry = SchemeRegistryFactory.createDefault(); | |
114 | - schemeRegistry.register(schemeRegistry.unregister("https")); | |
115 | - schemeRegistry.register(httpsScheme); | |
116 | - | |
117 | - ClientConnectionManager cm = new PoolingClientConnectionManager(schemeRegistry); | |
118 | - return new DefaultHttpClient(cm); | |
119 | - } | |
120 | - | |
121 | - private static boolean isBlank(String str) | |
122 | - { | |
123 | - int strLen; | |
124 | - if (str == null || (strLen = str.length()) == 0) { | |
125 | - return true; | |
132 | + public YoutrackAPI(String serviceLocation) | |
133 | + { | |
134 | + this(serviceLocation, null); | |
126 | 135 | } |
127 | - for (int i = 0; i < strLen; i++) { | |
128 | - if ((!Character.isWhitespace(str.charAt(i)))) { | |
129 | - return false; | |
130 | - } | |
136 | + | |
137 | + public YoutrackAPI(String serviceLocation, HttpClient httpClient) | |
138 | + { | |
139 | + if (serviceLocation == null) { | |
140 | + throw new IllegalArgumentException("serviceLocation cannot be null"); | |
141 | + } | |
142 | + this.serviceLocation = serviceLocation; | |
143 | + try { | |
144 | + serviceLocationURI = new URI(this.serviceLocation); | |
145 | + } catch (URISyntaxException e) { | |
146 | + throw new RuntimeException(e); | |
147 | + } | |
148 | + this.httpClient = httpClient == null ? getDefaultHttpClient() : httpClient; | |
131 | 149 | } |
132 | - return true; | |
133 | - } | |
134 | 150 | |
135 | -// --------------------------- CONSTRUCTORS --------------------------- | |
151 | + public YoutrackAPI(String serviceLocation, String username, String password) throws IOException, JAXBException | |
152 | + { | |
153 | + this(serviceLocation, null, username, password); | |
154 | + } | |
136 | 155 | |
137 | - public YoutrackAPI(String serviceLocation) | |
138 | - { | |
139 | - this(serviceLocation, null); | |
140 | - } | |
156 | + public YoutrackAPI(String serviceLocation, HttpClient httpClient, String username, String password) throws IOException, JAXBException | |
157 | + { | |
158 | + this(serviceLocation, httpClient); | |
159 | + login(username, password); | |
160 | + } | |
141 | 161 | |
142 | - public YoutrackAPI(String serviceLocation, HttpClient httpClient) | |
143 | - { | |
144 | - if (serviceLocation == null) { | |
145 | - throw new IllegalArgumentException("serviceLocation cannot be null"); | |
162 | + public String getServiceLocation() | |
163 | + { | |
164 | + return serviceLocation; | |
146 | 165 | } |
147 | - this.serviceLocation = serviceLocation; | |
148 | - try { | |
149 | - serviceLocationURI = new URI(this.serviceLocation); | |
150 | - } catch (URISyntaxException e) { | |
151 | - throw new RuntimeException(e); | |
166 | + | |
167 | + public void command(String issueId, String command) throws IOException | |
168 | + { | |
169 | + command(issueId, command, null, null, null, null); | |
152 | 170 | } |
153 | - this.httpClient = httpClient == null ? getDefaultHttpClient() : httpClient; | |
154 | - } | |
155 | - | |
156 | - public YoutrackAPI(String serviceLocation, String username, String password) throws IOException, JAXBException | |
157 | - { | |
158 | - this(serviceLocation, null, username, password); | |
159 | - } | |
160 | - | |
161 | - public YoutrackAPI(String serviceLocation, HttpClient httpClient, String username, String password) throws IOException, JAXBException | |
162 | - { | |
163 | - this(serviceLocation, httpClient); | |
164 | - login(username, password); | |
165 | - } | |
166 | - | |
167 | -// --------------------- GETTER / SETTER METHODS --------------------- | |
168 | - | |
169 | - public String getServiceLocation() | |
170 | - { | |
171 | - return serviceLocation; | |
172 | - } | |
173 | - | |
174 | -// -------------------------- OTHER METHODS -------------------------- | |
175 | - | |
176 | - public void command(String issueId, String command) throws IOException | |
177 | - { | |
178 | - command(issueId, command, null, null, null, null); | |
179 | - } | |
180 | - | |
181 | - public void command(String issueId, Command command) throws IOException | |
182 | - { | |
183 | - command(issueId, command.toString()); | |
184 | - } | |
185 | - | |
186 | - public void command(String issueId, String command, String comment, String group, Boolean disableNotifications, String runAs) throws IOException | |
187 | - { | |
188 | - final HttpPost request = new HttpPost(buildURI(serviceLocationURI, "/rest/issue/" + issueId + "/execute")); | |
189 | - final List<BasicNameValuePair> parameters = new ArrayList<BasicNameValuePair>(); | |
190 | - parameters.add(new BasicNameValuePair("command", command)); | |
191 | - if (!isBlank(comment)) { | |
192 | - parameters.add(new BasicNameValuePair("comment", comment)); | |
171 | + | |
172 | + public void command(String issueId, Command command) throws IOException | |
173 | + { | |
174 | + command(issueId, command.toString()); | |
193 | 175 | } |
194 | - if (!isBlank(group)) { | |
195 | - parameters.add(new BasicNameValuePair("group", group)); | |
176 | + | |
177 | + public void command(String issueId, String command, String comment, String group, Boolean disableNotifications, String runAs) throws IOException | |
178 | + { | |
179 | + final HttpPost request = new HttpPost(buildURI(serviceLocationURI, "/rest/issue/" + issueId + "/execute")); | |
180 | + final List<BasicNameValuePair> parameters = new ArrayList<BasicNameValuePair>(); | |
181 | + parameters.add(new BasicNameValuePair("command", command)); | |
182 | + if (!isBlank(comment)) { | |
183 | + parameters.add(new BasicNameValuePair("comment", comment)); | |
184 | + } | |
185 | + if (!isBlank(group)) { | |
186 | + parameters.add(new BasicNameValuePair("group", group)); | |
187 | + } | |
188 | + if (disableNotifications != null) { | |
189 | + parameters.add(new BasicNameValuePair("disableNotifications", disableNotifications.toString())); | |
190 | + } | |
191 | + if (!isBlank(runAs)) { | |
192 | + parameters.add(new BasicNameValuePair("runAs", runAs)); | |
193 | + } | |
194 | + request.setEntity(new UrlEncodedFormEntity(parameters)); | |
195 | + execute(request); | |
196 | 196 | } |
197 | - if (disableNotifications != null) { | |
198 | - parameters.add(new BasicNameValuePair("disableNotifications", disableNotifications.toString())); | |
197 | + | |
198 | + /** | |
199 | + * Creates new issue on Youtrack. | |
200 | + * | |
201 | + * @param project project to create issue in | |
202 | + * @param summary summary of the issue | |
203 | + * @param description longer description of the issue | |
204 | + * | |
205 | + * @return issue id of created issue | |
206 | + * | |
207 | + * @throws IOException in case of communication problems | |
208 | + */ | |
209 | + public String createIssue(String project, String summary, String description) throws IOException | |
210 | + { | |
211 | + final HttpPut request = createPutRequest(buildURI(serviceLocationURI, "/rest/issue"), new BasicNameValuePair("project", project), | |
212 | + new BasicNameValuePair("summary", summary), new BasicNameValuePair("description", description)); | |
213 | + final HttpResponse response = httpClient.execute(request); | |
214 | + final StatusLine statusLine = response.getStatusLine(); | |
215 | + final HttpEntity entity = response.getEntity(); | |
216 | + final String responseText = entity == null ? null : EntityUtils.toString(entity); | |
217 | + throwExceptionsIfNeeded(statusLine, responseText); | |
218 | + | |
219 | + final Header header = response.getFirstHeader(HttpHeaders.LOCATION); | |
220 | + if (header == null) { | |
221 | + throw new YoutrackAPIException("Missing location header despite positive status code: " + statusLine.getStatusCode()); | |
222 | + } | |
223 | + final String issueURL = header.getValue(); | |
224 | + final Matcher matcher = Pattern.compile(".*(" + project + "-\\d+)").matcher(issueURL); | |
225 | + if (!matcher.find() || matcher.groupCount() < 1) { | |
226 | + throw new YoutrackAPIException("Cannot extract issue id from issue URL: " + issueURL); | |
227 | + } | |
228 | + return matcher.group(1); | |
199 | 229 | } |
200 | - if (!isBlank(runAs)) { | |
201 | - parameters.add(new BasicNameValuePair("runAs", runAs)); | |
230 | + | |
231 | + public void deleteIssue(String issueId) throws IOException | |
232 | + { | |
233 | + execute(new HttpDelete(buildURI(serviceLocationURI, "/rest/issue/" + issueId))); | |
202 | 234 | } |
203 | - request.setEntity(new UrlEncodedFormEntity(parameters)); | |
204 | - execute(request); | |
205 | - } | |
206 | - | |
207 | - /** | |
208 | - * Creates new issue on Youtrack. | |
209 | - * | |
210 | - * @param project project to create issue in | |
211 | - * @param summary summary of the issue | |
212 | - * @param description longer description of the issue | |
213 | - * | |
214 | - * @return issue id of created issue | |
215 | - * | |
216 | - * @throws IOException in case of communication problems | |
217 | - */ | |
218 | - public String createIssue(String project, String summary, String description) throws IOException | |
219 | - { | |
220 | - final HttpPut request = createPutRequest(buildURI(serviceLocationURI, "/rest/issue"), new BasicNameValuePair("project", project), | |
221 | - new BasicNameValuePair("summary", summary), new BasicNameValuePair("description", description)); | |
222 | - final HttpResponse response = httpClient.execute(request); | |
223 | - final StatusLine statusLine = response.getStatusLine(); | |
224 | - final HttpEntity entity = response.getEntity(); | |
225 | - final String responseText = entity == null ? null : EntityUtils.toString(entity); | |
226 | - throwExceptionsIfNeeded(statusLine, responseText); | |
227 | - | |
228 | - final Header header = response.getFirstHeader(HttpHeaders.LOCATION); | |
229 | - if (header == null) { | |
230 | - throw new YoutrackAPIException("Missing location header despite positive status code: " + statusLine.getStatusCode()); | |
235 | + | |
236 | + public AssigneeList getAssignees(String project) throws IOException, JAXBException | |
237 | + { | |
238 | + final String responseString = execute(new HttpGet(buildURI(serviceLocationURI, "/rest/admin/project/" + project + "/assignee"))); | |
239 | + final Object result = YoutrackUnmarshaller.unmarshall(responseString); | |
240 | + if (result instanceof AssigneeList) { | |
241 | + return (AssigneeList) result; | |
242 | + } else { | |
243 | + throw new YoutrackAPIException("Unexpected type: " + result); | |
244 | + } | |
231 | 245 | } |
232 | - final String issueURL = header.getValue(); | |
233 | - final Matcher matcher = Pattern.compile(".*(" + project + "-\\d+)").matcher(issueURL); | |
234 | - if (!matcher.find() || matcher.groupCount() < 1) { | |
235 | - throw new YoutrackAPIException("Cannot extract issue id from issue URL: " + issueURL); | |
246 | + | |
247 | + public Enumeration getBundle(String customField) throws IOException, JAXBException | |
248 | + { | |
249 | + final Object result = YoutrackUnmarshaller.unmarshall( | |
250 | + execute(new HttpGet(buildURI(serviceLocationURI, "/rest/admin/customfield/bundle/" + customField)))); | |
251 | + if (result instanceof Enumeration) { | |
252 | + return (Enumeration) result; | |
253 | + } else if (result instanceof JAXBElement) { | |
254 | + final JAXBElement jaxbElement = (JAXBElement) result; | |
255 | + if (Enumeration_QNAME.equals(jaxbElement.getName())) { | |
256 | + return (Enumeration) ((JAXBElement) result).getValue(); | |
257 | + } else { | |
258 | + throw new YoutrackAPIException("Unexpected type: " + jaxbElement.getValue()); | |
259 | + } | |
260 | + } else { | |
261 | + throw new YoutrackAPIException("Unexpected type: " + result); | |
262 | + } | |
236 | 263 | } |
237 | - return matcher.group(1); | |
238 | - } | |
239 | - | |
240 | - public void deleteIssue(String issueId) throws IOException | |
241 | - { | |
242 | - execute(new HttpDelete(buildURI(serviceLocationURI, "/rest/issue/" + issueId))); | |
243 | - } | |
244 | - | |
245 | - public AssigneeList getAssignees(String project) throws IOException, JAXBException | |
246 | - { | |
247 | - final String responseString = execute(new HttpGet(buildURI(serviceLocationURI, "/rest/admin/project/" + project + "/assignee"))); | |
248 | - final Object result = YoutrackUnmarshaller.unmarshall(responseString); | |
249 | - if (result instanceof AssigneeList) { | |
250 | - return (AssigneeList) result; | |
251 | - } else { | |
252 | - throw new YoutrackAPIException("Unexpected type: " + result); | |
264 | + | |
265 | + public List<User> getIndividualAssignees(String project) throws IOException, JAXBException | |
266 | + { | |
267 | + final String responseString = execute(new HttpGet(buildURI(serviceLocationURI, "/rest/admin/project/" + project + "/assignee/individual"))); | |
268 | + final Object result = YoutrackUnmarshaller.unmarshall(responseString); | |
269 | + if (result instanceof UserRefs) { | |
270 | + return ((UserRefs) result).getUsers(); | |
271 | + } else { | |
272 | + throw new YoutrackAPIException("Unexpected type: " + result); | |
273 | + } | |
253 | 274 | } |
254 | - } | |
255 | - | |
256 | - public Enumeration getBundle(String customField) throws IOException, JAXBException | |
257 | - { | |
258 | - final Object result = YoutrackUnmarshaller.unmarshall(execute(new HttpGet(buildURI(serviceLocationURI, "/rest/admin/customfield/bundle/" + customField)))); | |
259 | - if (result instanceof Enumeration) { | |
260 | - return (Enumeration) result; | |
261 | - } else if (result instanceof JAXBElement) { | |
262 | - final JAXBElement jaxbElement = (JAXBElement) result; | |
263 | - if (Enumeration_QNAME.equals(jaxbElement.getName())) { | |
264 | - return (Enumeration) ((JAXBElement) result).getValue(); | |
265 | - } else { | |
266 | - throw new YoutrackAPIException("Unexpected type: " + jaxbElement.getValue()); | |
267 | - } | |
268 | - } else { | |
269 | - throw new YoutrackAPIException("Unexpected type: " + result); | |
275 | + | |
276 | + public IssueWrapper getIssue(String issueId) throws IOException, JAXBException | |
277 | + { | |
278 | + final String responseString; | |
279 | + try { | |
280 | + responseString = execute(new HttpGet(buildURI(serviceLocationURI, "/rest/issue/" + issueId))); | |
281 | + } catch (YoutrackErrorException e) { | |
282 | + if (e.getStatusCode() == HttpStatus.SC_NOT_FOUND) { | |
283 | + throw new NoResultFoundException(e.getMessage(), e); | |
284 | + } else { | |
285 | + throw e; | |
286 | + } | |
287 | + } | |
288 | + final Object result = YoutrackUnmarshaller.unmarshall(responseString); | |
289 | + if (result instanceof pl.itcrowd.youtrack.api.rest.Issue) { | |
290 | + return new IssueWrapper((Issue) result); | |
291 | + } else if (result instanceof JAXBElement) { | |
292 | + final JAXBElement jaxbElement = (JAXBElement) result; | |
293 | + if (Issue_QNAME.equals(jaxbElement.getName())) { | |
294 | + return new IssueWrapper((Issue) jaxbElement.getValue()); | |
295 | + } else { | |
296 | + throw new YoutrackAPIException("Unexpected type: " + jaxbElement.getValue()); | |
297 | + } | |
298 | + } else { | |
299 | + throw new YoutrackAPIException("Unexpected type " + result); | |
300 | + } | |
270 | 301 | } |
271 | - } | |
272 | - | |
273 | - public List<User> getIndividualAssignees(String project) throws IOException, JAXBException | |
274 | - { | |
275 | - final String responseString = execute(new HttpGet(buildURI(serviceLocationURI, "/rest/admin/project/" + project + "/assignee/individual"))); | |
276 | - final Object result = YoutrackUnmarshaller.unmarshall(responseString); | |
277 | - if (result instanceof UserRefs) { | |
278 | - return ((UserRefs) result).getUsers(); | |
279 | - } else { | |
280 | - throw new YoutrackAPIException("Unexpected type: " + result); | |
302 | + | |
303 | + public void login(String username, String password) throws IOException, JAXBException | |
304 | + { | |
305 | + final HttpPost request = new HttpPost(buildURI(serviceLocationURI, "/rest/user/login")); | |
306 | + request.setEntity(new UrlEncodedFormEntity(Arrays.asList(new BasicNameValuePair("login", username), new BasicNameValuePair("password", password)))); | |
307 | + execute(request); | |
281 | 308 | } |
282 | - } | |
283 | - | |
284 | - public IssueWrapper getIssue(String issueId) throws IOException, JAXBException | |
285 | - { | |
286 | - final String responseString; | |
287 | - try { | |
288 | - responseString = execute(new HttpGet(buildURI(serviceLocationURI, "/rest/issue/" + issueId))); | |
289 | - } catch (YoutrackErrorException e) { | |
290 | - if (e.getStatusCode() == HttpStatus.SC_NOT_FOUND) { | |
291 | - throw new NoResultFoundException(e.getMessage(), e); | |
292 | - } else { | |
293 | - throw e; | |
294 | - } | |
309 | + | |
310 | + public List<IssueWrapper> searchIssuesByProject(String project, Object filter) throws JAXBException, IOException | |
311 | + { | |
312 | + final Object result = YoutrackUnmarshaller.unmarshall( | |
313 | + execute(new HttpGet(buildURI(serviceLocationURI, "/rest/issue/byproject/" + project, "filter=" + (filter == null ? "" : filter))))); | |
314 | + if (!(result instanceof Issues)) { | |
315 | + throw new YoutrackAPIException("Unmarshalling problem. Expected Issues, received: " + result.getClass() + " " + result); | |
316 | + } | |
317 | + List<Issue> issues = ((Issues) result).getIssues(); | |
318 | + List<IssueWrapper> wrappedIssues = new ArrayList<IssueWrapper>(); | |
319 | + for (Issue issue : issues) { | |
320 | + wrappedIssues.add(new IssueWrapper(issue)); | |
321 | + } | |
322 | + return wrappedIssues; | |
295 | 323 | } |
296 | - final Object result = YoutrackUnmarshaller.unmarshall(responseString); | |
297 | - if (result instanceof pl.itcrowd.youtrack.api.rest.Issue) { | |
298 | - return new IssueWrapper((Issue) result); | |
299 | - } else if (result instanceof JAXBElement) { | |
300 | - final JAXBElement jaxbElement = (JAXBElement) result; | |
301 | - if (Issue_QNAME.equals(jaxbElement.getName())) { | |
302 | - return new IssueWrapper((Issue) jaxbElement.getValue()); | |
303 | - } else { | |
304 | - throw new YoutrackAPIException("Unexpected type: " + jaxbElement.getValue()); | |
305 | - } | |
306 | - } else { | |
307 | - throw new YoutrackAPIException("Unexpected type " + result); | |
324 | + | |
325 | + public void updateIssue(String issueId, String summary, String description) throws IOException | |
326 | + { | |
327 | + final HttpPost request = createPostRequest(buildURI(serviceLocationURI, "/rest/issue/" + issueId), | |
328 | + new BasicNameValuePair(Fields.summary.name(), summary), new BasicNameValuePair(Fields.description.name(), description)); | |
329 | + final HttpResponse response = httpClient.execute(request); | |
330 | + final StatusLine statusLine = response.getStatusLine(); | |
331 | + final HttpEntity entity = response.getEntity(); | |
332 | + final String responseText = entity == null ? null : EntityUtils.toString(entity); | |
333 | + throwExceptionsIfNeeded(statusLine, responseText); | |
308 | 334 | } |
309 | - } | |
310 | - | |
311 | - public void login(String username, String password) throws IOException, JAXBException | |
312 | - { | |
313 | - final HttpPost request = new HttpPost(buildURI(serviceLocationURI, "/rest/user/login")); | |
314 | - request.setEntity(new UrlEncodedFormEntity(Arrays.asList(new BasicNameValuePair("login", username), new BasicNameValuePair("password", password)))); | |
315 | - execute(request); | |
316 | - } | |
317 | - | |
318 | - public List<IssueWrapper> searchIssuesByProject(String project, Object filter) throws JAXBException, IOException | |
319 | - { | |
320 | - final Object result = YoutrackUnmarshaller.unmarshall( | |
321 | - execute(new HttpGet(buildURI(serviceLocationURI, "/rest/issue/byproject/" + project, "filter=" + (filter == null ? "" : filter))))); | |
322 | - if (!(result instanceof Issues)) { | |
323 | - throw new YoutrackAPIException("Unmarshalling problem. Expected Issues, received: " + result.getClass() + " " + result); | |
335 | + | |
336 | + private HttpPost createPostRequest(URI uri, NameValuePair... nameValuePair) throws UnsupportedEncodingException | |
337 | + { | |
338 | + return setEntity(new HttpPost(uri), nameValuePair); | |
324 | 339 | } |
325 | - List<Issue> issues = ((Issues) result).getIssues(); | |
326 | - List<IssueWrapper> wrappedIssues = new ArrayList<IssueWrapper>(); | |
327 | - for (Issue issue : issues) { | |
328 | - wrappedIssues.add(new IssueWrapper(issue)); | |
340 | + | |
341 | + private HttpPut createPutRequest(URI uri, NameValuePair... nameValuePair) throws UnsupportedEncodingException | |
342 | + { | |
343 | + return setEntity(new HttpPut(uri), nameValuePair); | |
329 | 344 | } |
330 | - return wrappedIssues; | |
331 | - } | |
332 | - | |
333 | - public void updateIssue(String issueId, String summary, String description) throws IOException | |
334 | - { | |
335 | - final HttpPost request = createPostRequest(buildURI(serviceLocationURI, "/rest/issue/" + issueId), new BasicNameValuePair(Fields.summary.name(), summary), | |
336 | - new BasicNameValuePair(Fields.description.name(), description)); | |
337 | - final HttpResponse response = httpClient.execute(request); | |
338 | - final StatusLine statusLine = response.getStatusLine(); | |
339 | - final HttpEntity entity = response.getEntity(); | |
340 | - final String responseText = entity == null ? null : EntityUtils.toString(entity); | |
341 | - throwExceptionsIfNeeded(statusLine, responseText); | |
342 | - } | |
343 | - | |
344 | - private HttpPost createPostRequest(URI uri, NameValuePair... nameValuePair) throws UnsupportedEncodingException | |
345 | - { | |
346 | - return setEntity(new HttpPost(uri), nameValuePair); | |
347 | - } | |
348 | - | |
349 | - private HttpPut createPutRequest(URI uri, NameValuePair... nameValuePair) throws UnsupportedEncodingException | |
350 | - { | |
351 | - return setEntity(new HttpPut(uri), nameValuePair); | |
352 | - } | |
353 | - | |
354 | - private String execute(HttpUriRequest request) throws IOException | |
355 | - { | |
356 | - final HttpResponse response = httpClient.execute(request); | |
357 | - final StatusLine statusLine = response.getStatusLine(); | |
358 | - final HttpEntity entity = response.getEntity(); | |
359 | - String responseText = entity == null ? null : EntityUtils.toString(entity); | |
360 | - if (statusLine.getStatusCode() >= 300) { | |
361 | - try { | |
362 | - final String error = ErrorUnmarshaller.unmarshal(responseText); | |
363 | - throw new YoutrackErrorException(error, statusLine.getStatusCode()); | |
364 | - } catch (JAXBException e) { | |
365 | - LOG.error("Cannot unmarshal following response text:\n" + responseText, e); | |
366 | - throw new HttpResponseException(statusLine.getStatusCode(), responseText); | |
367 | - } | |
345 | + | |
346 | + private String execute(HttpUriRequest request) throws IOException | |
347 | + { | |
348 | + final HttpResponse response = httpClient.execute(request); | |
349 | + final StatusLine statusLine = response.getStatusLine(); | |
350 | + final HttpEntity entity = response.getEntity(); | |
351 | + String responseText = entity == null ? null : EntityUtils.toString(entity); | |
352 | + if (statusLine.getStatusCode() >= 300) { | |
353 | + try { | |
354 | + final String error = ErrorUnmarshaller.unmarshal(responseText); | |
355 | + throw new YoutrackErrorException(error, statusLine.getStatusCode()); | |
356 | + } catch (JAXBException e) { | |
357 | + LOG.error("Cannot unmarshal following response text:\n" + responseText, e); | |
358 | + throw new HttpResponseException(statusLine.getStatusCode(), responseText); | |
359 | + } | |
360 | + } | |
361 | + if (entity == null) { | |
362 | + throw new ClientProtocolException("Response contains no content"); | |
363 | + } | |
364 | + return responseText; | |
368 | 365 | } |
369 | - if (entity == null) { | |
370 | - throw new ClientProtocolException("Response contains no content"); | |
366 | + | |
367 | + private <T extends HttpEntityEnclosingRequestBase> T setEntity(T request, NameValuePair[] nameValuePair) throws UnsupportedEncodingException | |
368 | + { | |
369 | + final ArrayList<NameValuePair> list = new ArrayList<NameValuePair>(); | |
370 | + Collections.addAll(list, nameValuePair); | |
371 | + request.setEntity(new UrlEncodedFormEntity(list)); | |
372 | + return request; | |
371 | 373 | } |
372 | - return responseText; | |
373 | - } | |
374 | - | |
375 | - private <T extends HttpEntityEnclosingRequestBase> T setEntity(T request, NameValuePair[] nameValuePair) throws UnsupportedEncodingException | |
376 | - { | |
377 | - final ArrayList<NameValuePair> list = new ArrayList<NameValuePair>(); | |
378 | - Collections.addAll(list, nameValuePair); | |
379 | - request.setEntity(new UrlEncodedFormEntity(list)); | |
380 | - return request; | |
381 | - } | |
382 | - | |
383 | - private void throwExceptionsIfNeeded(StatusLine statusLine, String responseText) throws IOException | |
384 | - { | |
385 | - if (statusLine.getStatusCode() >= 300) { | |
386 | - throw new HttpResponseException(statusLine.getStatusCode(), responseText); | |
374 | + | |
375 | + private void throwExceptionsIfNeeded(StatusLine statusLine, String responseText) throws IOException | |
376 | + { | |
377 | + if (statusLine.getStatusCode() >= 300) { | |
378 | + throw new HttpResponseException(statusLine.getStatusCode(), responseText); | |
379 | + } | |
387 | 380 | } |
388 | - } | |
389 | 381 | } |
\ No newline at end of file | ... | ... |
... | ... | @@ -8,7 +8,6 @@ import java.io.Reader; |
8 | 8 | import java.io.StringReader; |
9 | 9 | |
10 | 10 | public final class YoutrackUnmarshaller { |
11 | -// -------------------------- STATIC METHODS -------------------------- | |
12 | 11 | |
13 | 12 | public static Object unmarshall(String string) throws JAXBException |
14 | 13 | { |
... | ... | @@ -20,8 +19,6 @@ public final class YoutrackUnmarshaller { |
20 | 19 | return JAXBContext.newInstance(ObjectFactory.class).createUnmarshaller().unmarshal(reader); |
21 | 20 | } |
22 | 21 | |
23 | -// --------------------------- CONSTRUCTORS --------------------------- | |
24 | - | |
25 | 22 | private YoutrackUnmarshaller() |
26 | 23 | { |
27 | 24 | } | ... | ... |
... | ... | @@ -4,12 +4,8 @@ public enum DateValues { |
4 | 4 | Today, Yesterday, Saturday, Friday, Thursday, Wednesday, Tuesday, Monday, Sunday, ThisWeek("{This week}"), LastWeek("{Last week}"), TwoWeeksAgo( |
5 | 5 | "{Two weeks ago}"), ThreeWeeksAgo("{Three weeks ago}"), ThisMonth("{This month}"), LastMonth("{Last month}"); |
6 | 6 | |
7 | -// ------------------------------ FIELDS ------------------------------ | |
8 | - | |
9 | 7 | private String filterValue; |
10 | 8 | |
11 | -// --------------------------- CONSTRUCTORS --------------------------- | |
12 | - | |
13 | 9 | private DateValues() |
14 | 10 | { |
15 | 11 | filterValue = name(); |
... | ... | @@ -20,8 +16,6 @@ public enum DateValues { |
20 | 16 | this.filterValue = filterValue; |
21 | 17 | } |
22 | 18 | |
23 | -// --------------------- GETTER / SETTER METHODS --------------------- | |
24 | - | |
25 | 19 | public String getFilterValue() |
26 | 20 | { |
27 | 21 | return filterValue; | ... | ... |
... | ... | @@ -16,12 +16,8 @@ public enum Fields implements Commander { |
16 | 16 | updated, |
17 | 17 | updaterName("updated by"); |
18 | 18 | |
19 | -// ------------------------------ FIELDS ------------------------------ | |
20 | - | |
21 | 19 | private String command; |
22 | 20 | |
23 | -// --------------------------- CONSTRUCTORS --------------------------- | |
24 | - | |
25 | 21 | private Fields() |
26 | 22 | { |
27 | 23 | command = name(); |
... | ... | @@ -32,8 +28,6 @@ public enum Fields implements Commander { |
32 | 28 | this.command = command; |
33 | 29 | } |
34 | 30 | |
35 | -// --------------------- GETTER / SETTER METHODS --------------------- | |
36 | - | |
37 | 31 | public String getCommand() |
38 | 32 | { |
39 | 33 | if (command == null) { | ... | ... |
... | ... | @@ -30,16 +30,12 @@ public enum StateValues { |
30 | 30 | Resolved("Resolved", null), |
31 | 31 | Unresolved("Unresolved", null); |
32 | 32 | |
33 | -// ------------------------------ FIELDS ------------------------------ | |
34 | - | |
35 | 33 | private String commandValue; |
36 | 34 | |
37 | 35 | private String filterValue; |
38 | 36 | |
39 | 37 | private boolean not; |
40 | 38 | |
41 | -// --------------------------- CONSTRUCTORS --------------------------- | |
42 | - | |
43 | 39 | private StateValues() |
44 | 40 | { |
45 | 41 | this(false); |
... | ... | @@ -67,16 +63,12 @@ public enum StateValues { |
67 | 63 | this.commandValue = commandValue == null ? name() : commandValue; |
68 | 64 | } |
69 | 65 | |
70 | -// ------------------------ CANONICAL METHODS ------------------------ | |
71 | - | |
72 | 66 | @Override |
73 | 67 | public String toString() |
74 | 68 | { |
75 | 69 | return getCommandValue(); |
76 | 70 | } |
77 | 71 | |
78 | -// -------------------------- OTHER METHODS -------------------------- | |
79 | - | |
80 | 72 | public String getCommandValue() |
81 | 73 | { |
82 | 74 | return (not ? "-" : "") + commandValue; | ... | ... |
1 | 1 | package pl.itcrowd.youtrack.api.exceptions; |
2 | 2 | |
3 | 3 | public class YoutrackErrorException extends RuntimeException { |
4 | -// ------------------------------ FIELDS ------------------------------ | |
5 | 4 | |
6 | 5 | private int statusCode; |
7 | 6 | |
8 | -// --------------------------- CONSTRUCTORS --------------------------- | |
9 | - | |
10 | 7 | public YoutrackErrorException(String message, int statusCode) |
11 | 8 | { |
12 | 9 | super(message); |
13 | 10 | this.statusCode = statusCode; |
14 | 11 | } |
15 | 12 | |
16 | -// --------------------- GETTER / SETTER METHODS --------------------- | |
17 | - | |
18 | 13 | public int getStatusCode() |
19 | 14 | { |
20 | 15 | return statusCode; | ... | ... |
... | ... | @@ -30,13 +30,10 @@ import javax.xml.bind.annotation.XmlType; |
30 | 30 | @XmlAccessorType(XmlAccessType.FIELD) |
31 | 31 | @XmlType(name = "assignedByType", propOrder = {"userGroupRef"}) |
32 | 32 | public class AssignedByType { |
33 | -// ------------------------------ FIELDS ------------------------------ | |
34 | 33 | |
35 | 34 | @XmlElement(required = true) |
36 | 35 | protected UserGroupRefType userGroupRef; |
37 | 36 | |
38 | -// --------------------- GETTER / SETTER METHODS --------------------- | |
39 | - | |
40 | 37 | /** |
41 | 38 | * Gets the value of the userGroupRef property. |
42 | 39 | * | ... | ... |
... | ... | @@ -47,7 +47,6 @@ import java.util.List; |
47 | 47 | @XmlType(name = "", propOrder = {"assignees"}) |
48 | 48 | @XmlRootElement(name = "assigneeList") |
49 | 49 | public class AssigneeList { |
50 | -// ------------------------------ FIELDS ------------------------------ | |
51 | 50 | |
52 | 51 | @XmlElement(required = true) |
53 | 52 | protected AssigneeList.Assignees assignees; |
... | ... | @@ -58,8 +57,6 @@ public class AssigneeList { |
58 | 57 | @XmlAttribute |
59 | 58 | protected String individualsUrl; |
60 | 59 | |
61 | -// --------------------- GETTER / SETTER METHODS --------------------- | |
62 | - | |
63 | 60 | /** |
64 | 61 | * Gets the value of the assignees property. |
65 | 62 | * |
... | ... | @@ -126,8 +123,6 @@ public class AssigneeList { |
126 | 123 | this.individualsUrl = value; |
127 | 124 | } |
128 | 125 | |
129 | -// -------------------------- INNER CLASSES -------------------------- | |
130 | - | |
131 | 126 | /** |
132 | 127 | * <p>Java class for anonymous complex type. |
133 | 128 | * <p/> |
... | ... | @@ -148,13 +143,10 @@ public class AssigneeList { |
148 | 143 | @XmlAccessorType(XmlAccessType.FIELD) |
149 | 144 | @XmlType(name = "", propOrder = {"assignees"}) |
150 | 145 | public static class Assignees { |
151 | -// ------------------------------ FIELDS ------------------------------ | |
152 | 146 | |
153 | 147 | @XmlElement(name = "assignee") |
154 | 148 | protected List<AssigneeType> assignees; |
155 | 149 | |
156 | -// --------------------- GETTER / SETTER METHODS --------------------- | |
157 | - | |
158 | 150 | /** |
159 | 151 | * Gets the value of the assignees property. |
160 | 152 | * <p/> | ... | ... |
... | ... | @@ -33,18 +33,15 @@ import javax.xml.bind.annotation.XmlType; |
33 | 33 | @XmlAccessorType(XmlAccessType.FIELD) |
34 | 34 | @XmlType(name = "assigneeType", propOrder = {"assignedBy"}) |
35 | 35 | public class AssigneeType { |
36 | -// ------------------------------ FIELDS ------------------------------ | |
37 | 36 | |
38 | 37 | @XmlElement(required = true) |
39 | 38 | protected AssignedByType assignedBy; |
40 | 39 | |
41 | 40 | @XmlAttribute |
42 | - protected String isIndividualAssignee; | |
43 | - | |
44 | - @XmlAttribute | |
45 | 41 | protected String login; |
46 | 42 | |
47 | -// --------------------- GETTER / SETTER METHODS --------------------- | |
43 | + @XmlAttribute | |
44 | + protected String isIndividualAssignee; | |
48 | 45 | |
49 | 46 | /** |
50 | 47 | * Gets the value of the assignedBy property. |
... | ... | @@ -69,46 +66,46 @@ public class AssigneeType { |
69 | 66 | } |
70 | 67 | |
71 | 68 | /** |
72 | - * Gets the value of the isIndividualAssignee property. | |
69 | + * Gets the value of the login property. | |
73 | 70 | * |
74 | 71 | * @return possible object is |
75 | 72 | * {@link String } |
76 | 73 | */ |
77 | - public String getIsIndividualAssignee() | |
74 | + public String getLogin() | |
78 | 75 | { |
79 | - return isIndividualAssignee; | |
76 | + return login; | |
80 | 77 | } |
81 | 78 | |
82 | 79 | /** |
83 | - * Sets the value of the isIndividualAssignee property. | |
80 | + * Sets the value of the login property. | |
84 | 81 | * |
85 | 82 | * @param value allowed object is |
86 | 83 | * {@link String } |
87 | 84 | */ |
88 | - public void setIsIndividualAssignee(String value) | |
85 | + public void setLogin(String value) | |
89 | 86 | { |
90 | - this.isIndividualAssignee = value; | |
87 | + this.login = value; | |
91 | 88 | } |
92 | 89 | |
93 | 90 | /** |
94 | - * Gets the value of the login property. | |
91 | + * Gets the value of the isIndividualAssignee property. | |
95 | 92 | * |
96 | 93 | * @return possible object is |
97 | 94 | * {@link String } |
98 | 95 | */ |
99 | - public String getLogin() | |
96 | + public String getIsIndividualAssignee() | |
100 | 97 | { |
101 | - return login; | |
98 | + return isIndividualAssignee; | |
102 | 99 | } |
103 | 100 | |
104 | 101 | /** |
105 | - * Sets the value of the login property. | |
102 | + * Sets the value of the isIndividualAssignee property. | |
106 | 103 | * |
107 | 104 | * @param value allowed object is |
108 | 105 | * {@link String } |
109 | 106 | */ |
110 | - public void setLogin(String value) | |
107 | + public void setIsIndividualAssignee(String value) | |
111 | 108 | { |
112 | - this.login = value; | |
109 | + this.isIndividualAssignee = value; | |
113 | 110 | } |
114 | 111 | } | ... | ... |
... | ... | @@ -57,62 +57,37 @@ import java.util.List; |
57 | 57 | @XmlAccessorType(XmlAccessType.FIELD) |
58 | 58 | @XmlType(name = "commentType", propOrder = {"content"}) |
59 | 59 | public class Comment { |
60 | -// ------------------------------ FIELDS ------------------------------ | |
61 | 60 | |
62 | - @XmlAttribute | |
63 | - protected String author; | |
64 | - | |
65 | - @XmlElementRefs({@XmlElementRef(name = "value", type = JAXBElement.class), @XmlElementRef(name = "replies", type = JAXBElement.class)}) | |
61 | + @XmlElementRefs({@XmlElementRef(name = "replies", type = JAXBElement.class), @XmlElementRef(name = "value", type = JAXBElement.class)}) | |
66 | 62 | @XmlMixed |
67 | 63 | protected List<Serializable> content; |
68 | 64 | |
69 | 65 | @XmlAttribute |
70 | - protected Long created; | |
66 | + protected String id; | |
71 | 67 | |
72 | 68 | @XmlAttribute |
73 | - protected String deleted; | |
69 | + protected String author; | |
74 | 70 | |
75 | 71 | @XmlAttribute |
76 | - protected String id; | |
72 | + protected String issueId; | |
77 | 73 | |
78 | 74 | @XmlAttribute |
79 | - protected String issueId; | |
75 | + protected String deleted; | |
80 | 76 | |
81 | 77 | @XmlAttribute |
82 | - protected String name; | |
78 | + protected String text; | |
83 | 79 | |
84 | 80 | @XmlAttribute |
85 | 81 | protected String shownForIssueAuthor; |
86 | 82 | |
87 | 83 | @XmlAttribute |
88 | - protected String text; | |
84 | + protected Long created; | |
89 | 85 | |
90 | 86 | @XmlAttribute |
91 | 87 | protected Long updated; |
92 | 88 | |
93 | -// --------------------- GETTER / SETTER METHODS --------------------- | |
94 | - | |
95 | - /** | |
96 | - * Gets the value of the author property. | |
97 | - * | |
98 | - * @return possible object is | |
99 | - * {@link String } | |
100 | - */ | |
101 | - public String getAuthor() | |
102 | - { | |
103 | - return author; | |
104 | - } | |
105 | - | |
106 | - /** | |
107 | - * Sets the value of the author property. | |
108 | - * | |
109 | - * @param value allowed object is | |
110 | - * {@link String } | |
111 | - */ | |
112 | - public void setAuthor(String value) | |
113 | - { | |
114 | - this.author = value; | |
115 | - } | |
89 | + @XmlAttribute | |
90 | + protected String name; | |
116 | 91 | |
117 | 92 | /** |
118 | 93 | * Gets the value of the content property. |
... | ... | @@ -132,9 +107,9 @@ public class Comment { |
132 | 107 | * <p/> |
133 | 108 | * <p/> |
134 | 109 | * Objects of the following type(s) are allowed in the list |
135 | - * {@link String } | |
136 | 110 | * {@link JAXBElement }{@code <}{@link Comment.Value }{@code >} |
137 | 111 | * {@link JAXBElement }{@code <}{@link String }{@code >} |
112 | + * {@link String } | |
138 | 113 | */ |
139 | 114 | public List<Serializable> getContent() |
140 | 115 | { |
... | ... | @@ -145,113 +120,113 @@ public class Comment { |
145 | 120 | } |
146 | 121 | |
147 | 122 | /** |
148 | - * Gets the value of the created property. | |
123 | + * Gets the value of the id property. | |
149 | 124 | * |
150 | 125 | * @return possible object is |
151 | - * {@link Long } | |
126 | + * {@link String } | |
152 | 127 | */ |
153 | - public Long getCreated() | |
128 | + public String getId() | |
154 | 129 | { |
155 | - return created; | |
130 | + return id; | |
156 | 131 | } |
157 | 132 | |
158 | 133 | /** |
159 | - * Sets the value of the created property. | |
134 | + * Sets the value of the id property. | |
160 | 135 | * |
161 | 136 | * @param value allowed object is |
162 | - * {@link Long } | |
137 | + * {@link String } | |
163 | 138 | */ |
164 | - public void setCreated(Long value) | |
139 | + public void setId(String value) | |
165 | 140 | { |
166 | - this.created = value; | |
141 | + this.id = value; | |
167 | 142 | } |
168 | 143 | |
169 | 144 | /** |
170 | - * Gets the value of the deleted property. | |
145 | + * Gets the value of the author property. | |
171 | 146 | * |
172 | 147 | * @return possible object is |
173 | 148 | * {@link String } |
174 | 149 | */ |
175 | - public String getDeleted() | |
150 | + public String getAuthor() | |
176 | 151 | { |
177 | - return deleted; | |
152 | + return author; | |
178 | 153 | } |
179 | 154 | |
180 | 155 | /** |
181 | - * Sets the value of the deleted property. | |
156 | + * Sets the value of the author property. | |
182 | 157 | * |
183 | 158 | * @param value allowed object is |
184 | 159 | * {@link String } |
185 | 160 | */ |
186 | - public void setDeleted(String value) | |
161 | + public void setAuthor(String value) | |
187 | 162 | { |
188 | - this.deleted = value; | |
163 | + this.author = value; | |
189 | 164 | } |
190 | 165 | |
191 | 166 | /** |
192 | - * Gets the value of the id property. | |
167 | + * Gets the value of the issueId property. | |
193 | 168 | * |
194 | 169 | * @return possible object is |
195 | 170 | * {@link String } |
196 | 171 | */ |
197 | - public String getId() | |
172 | + public String getIssueId() | |
198 | 173 | { |
199 | - return id; | |
174 | + return issueId; | |
200 | 175 | } |
201 | 176 | |
202 | 177 | /** |
203 | - * Sets the value of the id property. | |
178 | + * Sets the value of the issueId property. | |
204 | 179 | * |
205 | 180 | * @param value allowed object is |
206 | 181 | * {@link String } |
207 | 182 | */ |
208 | - public void setId(String value) | |
183 | + public void setIssueId(String value) | |
209 | 184 | { |
210 | - this.id = value; | |
185 | + this.issueId = value; | |
211 | 186 | } |
212 | 187 | |
213 | 188 | /** |
214 | - * Gets the value of the issueId property. | |
189 | + * Gets the value of the deleted property. | |
215 | 190 | * |
216 | 191 | * @return possible object is |
217 | 192 | * {@link String } |
218 | 193 | */ |
219 | - public String getIssueId() | |
194 | + public String getDeleted() | |
220 | 195 | { |
221 | - return issueId; | |
196 | + return deleted; | |
222 | 197 | } |
223 | 198 | |
224 | 199 | /** |
225 | - * Sets the value of the issueId property. | |
200 | + * Sets the value of the deleted property. | |
226 | 201 | * |
227 | 202 | * @param value allowed object is |
228 | 203 | * {@link String } |
229 | 204 | */ |
230 | - public void setIssueId(String value) | |
205 | + public void setDeleted(String value) | |
231 | 206 | { |
232 | - this.issueId = value; | |
207 | + this.deleted = value; | |
233 | 208 | } |
234 | 209 | |
235 | 210 | /** |
236 | - * Gets the value of the name property. | |
211 | + * Gets the value of the text property. | |
237 | 212 | * |
238 | 213 | * @return possible object is |
239 | 214 | * {@link String } |
240 | 215 | */ |
241 | - public String getName() | |
216 | + public String getText() | |
242 | 217 | { |
243 | - return name; | |
218 | + return text; | |
244 | 219 | } |
245 | 220 | |
246 | 221 | /** |
247 | - * Sets the value of the name property. | |
222 | + * Sets the value of the text property. | |
248 | 223 | * |
249 | 224 | * @param value allowed object is |
250 | 225 | * {@link String } |
251 | 226 | */ |
252 | - public void setName(String value) | |
227 | + public void setText(String value) | |
253 | 228 | { |
254 | - this.name = value; | |
229 | + this.text = value; | |
255 | 230 | } |
256 | 231 | |
257 | 232 | /** |
... | ... | @@ -277,25 +252,25 @@ public class Comment { |
277 | 252 | } |
278 | 253 | |
279 | 254 | /** |
280 | - * Gets the value of the text property. | |
255 | + * Gets the value of the created property. | |
281 | 256 | * |
282 | 257 | * @return possible object is |
283 | - * {@link String } | |
258 | + * {@link Long } | |
284 | 259 | */ |
285 | - public String getText() | |
260 | + public Long getCreated() | |
286 | 261 | { |
287 | - return text; | |
262 | + return created; | |
288 | 263 | } |
289 | 264 | |
290 | 265 | /** |
291 | - * Sets the value of the text property. | |
266 | + * Sets the value of the created property. | |
292 | 267 | * |
293 | 268 | * @param value allowed object is |
294 | - * {@link String } | |
269 | + * {@link Long } | |
295 | 270 | */ |
296 | - public void setText(String value) | |
271 | + public void setCreated(Long value) | |
297 | 272 | { |
298 | - this.text = value; | |
273 | + this.created = value; | |
299 | 274 | } |
300 | 275 | |
301 | 276 | /** |
... | ... | @@ -320,7 +295,27 @@ public class Comment { |
320 | 295 | this.updated = value; |
321 | 296 | } |
322 | 297 | |
323 | -// -------------------------- INNER CLASSES -------------------------- | |
298 | + /** | |
299 | + * Gets the value of the name property. | |
300 | + * | |
301 | + * @return possible object is | |
302 | + * {@link String } | |
303 | + */ | |
304 | + public String getName() | |
305 | + { | |
306 | + return name; | |
307 | + } | |
308 | + | |
309 | + /** | |
310 | + * Sets the value of the name property. | |
311 | + * | |
312 | + * @param value allowed object is | |
313 | + * {@link String } | |
314 | + */ | |
315 | + public void setName(String value) | |
316 | + { | |
317 | + this.name = value; | |
318 | + } | |
324 | 319 | |
325 | 320 | /** |
326 | 321 | * <p>Java class for anonymous complex type. |
... | ... | @@ -341,39 +336,36 @@ public class Comment { |
341 | 336 | @XmlAccessorType(XmlAccessType.FIELD) |
342 | 337 | @XmlType(name = "", propOrder = {"value"}) |
343 | 338 | public static class Value { |
344 | -// ------------------------------ FIELDS ------------------------------ | |
345 | 339 | |
346 | - @XmlAttribute | |
347 | - protected String role; | |
340 | + @XmlValue | |
341 | + protected String value; | |
348 | 342 | |
349 | 343 | @XmlAttribute |
350 | 344 | protected String type; |
351 | 345 | |
352 | - @XmlValue | |
353 | - protected String value; | |
354 | - | |
355 | -// --------------------- GETTER / SETTER METHODS --------------------- | |
346 | + @XmlAttribute | |
347 | + protected String role; | |
356 | 348 | |
357 | 349 | /** |
358 | - * Gets the value of the role property. | |
350 | + * Gets the value of the value property. | |
359 | 351 | * |
360 | 352 | * @return possible object is |
361 | 353 | * {@link String } |
362 | 354 | */ |
363 | - public String getRole() | |
355 | + public String getValue() | |
364 | 356 | { |
365 | - return role; | |
357 | + return value; | |
366 | 358 | } |
367 | 359 | |
368 | 360 | /** |
369 | - * Sets the value of the role property. | |
361 | + * Sets the value of the value property. | |
370 | 362 | * |
371 | 363 | * @param value allowed object is |
372 | 364 | * {@link String } |
373 | 365 | */ |
374 | - public void setRole(String value) | |
366 | + public void setValue(String value) | |
375 | 367 | { |
376 | - this.role = value; | |
368 | + this.value = value; | |
377 | 369 | } |
378 | 370 | |
379 | 371 | /** |
... | ... | @@ -399,25 +391,25 @@ public class Comment { |
399 | 391 | } |
400 | 392 | |
401 | 393 | /** |
402 | - * Gets the value of the value property. | |
394 | + * Gets the value of the role property. | |
403 | 395 | * |
404 | 396 | * @return possible object is |
405 | 397 | * {@link String } |
406 | 398 | */ |
407 | - public String getValue() | |
399 | + public String getRole() | |
408 | 400 | { |
409 | - return value; | |
401 | + return role; | |
410 | 402 | } |
411 | 403 | |
412 | 404 | /** |
413 | - * Sets the value of the value property. | |
405 | + * Sets the value of the role property. | |
414 | 406 | * |
415 | 407 | * @param value allowed object is |
416 | 408 | * {@link String } |
417 | 409 | */ |
418 | - public void setValue(String value) | |
410 | + public void setRole(String value) | |
419 | 411 | { |
420 | - this.value = value; | |
412 | + this.role = value; | |
421 | 413 | } |
422 | 414 | } |
423 | 415 | } | ... | ... |
... | ... | @@ -34,37 +34,12 @@ import java.util.List; |
34 | 34 | @XmlAccessorType(XmlAccessType.FIELD) |
35 | 35 | @XmlType(name = "enumerationType", propOrder = {"values"}) |
36 | 36 | public class Enumeration { |
37 | -// ------------------------------ FIELDS ------------------------------ | |
38 | - | |
39 | - @XmlAttribute | |
40 | - protected String name; | |
41 | 37 | |
42 | 38 | @XmlElement(name = "value") |
43 | 39 | protected List<EnumerationValue> values; |
44 | 40 | |
45 | -// --------------------- GETTER / SETTER METHODS --------------------- | |
46 | - | |
47 | - /** | |
48 | - * Gets the value of the name property. | |
49 | - * | |
50 | - * @return possible object is | |
51 | - * {@link String } | |
52 | - */ | |
53 | - public String getName() | |
54 | - { | |
55 | - return name; | |
56 | - } | |
57 | - | |
58 | - /** | |
59 | - * Sets the value of the name property. | |
60 | - * | |
61 | - * @param value allowed object is | |
62 | - * {@link String } | |
63 | - */ | |
64 | - public void setName(String value) | |
65 | - { | |
66 | - this.name = value; | |
67 | - } | |
41 | + @XmlAttribute | |
42 | + protected String name; | |
68 | 43 | |
69 | 44 | /** |
70 | 45 | * Gets the value of the values property. |
... | ... | @@ -93,4 +68,26 @@ public class Enumeration { |
93 | 68 | } |
94 | 69 | return this.values; |
95 | 70 | } |
71 | + | |
72 | + /** | |
73 | + * Gets the value of the name property. | |
74 | + * | |
75 | + * @return possible object is | |
76 | + * {@link String } | |
77 | + */ | |
78 | + public String getName() | |
79 | + { | |
80 | + return name; | |
81 | + } | |
82 | + | |
83 | + /** | |
84 | + * Sets the value of the name property. | |
85 | + * | |
86 | + * @param value allowed object is | |
87 | + * {@link String } | |
88 | + */ | |
89 | + public void setName(String value) | |
90 | + { | |
91 | + this.name = value; | |
92 | + } | |
96 | 93 | } | ... | ... |
... | ... | @@ -29,57 +29,54 @@ import javax.xml.bind.annotation.XmlValue; |
29 | 29 | @XmlAccessorType(XmlAccessType.FIELD) |
30 | 30 | @XmlType(name = "enumerationValueType", propOrder = {"value"}) |
31 | 31 | public class EnumerationValue { |
32 | -// ------------------------------ FIELDS ------------------------------ | |
33 | - | |
34 | - @XmlAttribute | |
35 | - protected Long colorIndex; | |
36 | 32 | |
37 | 33 | @XmlValue |
38 | 34 | protected String value; |
39 | 35 | |
40 | -// --------------------- GETTER / SETTER METHODS --------------------- | |
36 | + @XmlAttribute | |
37 | + protected Long colorIndex; | |
41 | 38 | |
42 | 39 | /** |
43 | - * Gets the value of the colorIndex property. | |
40 | + * Gets the value of the value property. | |
44 | 41 | * |
45 | 42 | * @return possible object is |
46 | - * {@link Long } | |
43 | + * {@link String } | |
47 | 44 | */ |
48 | - public Long getColorIndex() | |
45 | + public String getValue() | |
49 | 46 | { |
50 | - return colorIndex; | |
47 | + return value; | |
51 | 48 | } |
52 | 49 | |
53 | 50 | /** |
54 | - * Sets the value of the colorIndex property. | |
51 | + * Sets the value of the value property. | |
55 | 52 | * |
56 | 53 | * @param value allowed object is |
57 | - * {@link Long } | |
54 | + * {@link String } | |
58 | 55 | */ |
59 | - public void setColorIndex(Long value) | |
56 | + public void setValue(String value) | |
60 | 57 | { |
61 | - this.colorIndex = value; | |
58 | + this.value = value; | |
62 | 59 | } |
63 | 60 | |
64 | 61 | /** |
65 | - * Gets the value of the value property. | |
62 | + * Gets the value of the colorIndex property. | |
66 | 63 | * |
67 | 64 | * @return possible object is |
68 | - * {@link String } | |
65 | + * {@link Long } | |
69 | 66 | */ |
70 | - public String getValue() | |
67 | + public Long getColorIndex() | |
71 | 68 | { |
72 | - return value; | |
69 | + return colorIndex; | |
73 | 70 | } |
74 | 71 | |
75 | 72 | /** |
76 | - * Sets the value of the value property. | |
73 | + * Sets the value of the colorIndex property. | |
77 | 74 | * |
78 | 75 | * @param value allowed object is |
79 | - * {@link String } | |
76 | + * {@link Long } | |
80 | 77 | */ |
81 | - public void setValue(String value) | |
78 | + public void setColorIndex(Long value) | |
82 | 79 | { |
83 | - this.value = value; | |
80 | + this.colorIndex = value; | |
84 | 81 | } |
85 | 82 | } | ... | ... |
... | ... | @@ -44,37 +44,12 @@ import java.util.List; |
44 | 44 | @XmlAccessorType(XmlAccessType.FIELD) |
45 | 45 | @XmlType(name = "fieldType", propOrder = {"values"}) |
46 | 46 | public class Field { |
47 | -// ------------------------------ FIELDS ------------------------------ | |
48 | - | |
49 | - @XmlAttribute | |
50 | - protected String name; | |
51 | 47 | |
52 | 48 | @XmlElement(name = "value") |
53 | 49 | protected List<Field.Value> values; |
54 | 50 | |
55 | -// --------------------- GETTER / SETTER METHODS --------------------- | |
56 | - | |
57 | - /** | |
58 | - * Gets the value of the name property. | |
59 | - * | |
60 | - * @return possible object is | |
61 | - * {@link String } | |
62 | - */ | |
63 | - public String getName() | |
64 | - { | |
65 | - return name; | |
66 | - } | |
67 | - | |
68 | - /** | |
69 | - * Sets the value of the name property. | |
70 | - * | |
71 | - * @param value allowed object is | |
72 | - * {@link String } | |
73 | - */ | |
74 | - public void setName(String value) | |
75 | - { | |
76 | - this.name = value; | |
77 | - } | |
51 | + @XmlAttribute | |
52 | + protected String name; | |
78 | 53 | |
79 | 54 | /** |
80 | 55 | * Gets the value of the values property. |
... | ... | @@ -104,7 +79,27 @@ public class Field { |
104 | 79 | return this.values; |
105 | 80 | } |
106 | 81 | |
107 | -// -------------------------- INNER CLASSES -------------------------- | |
82 | + /** | |
83 | + * Gets the value of the name property. | |
84 | + * | |
85 | + * @return possible object is | |
86 | + * {@link String } | |
87 | + */ | |
88 | + public String getName() | |
89 | + { | |
90 | + return name; | |
91 | + } | |
92 | + | |
93 | + /** | |
94 | + * Sets the value of the name property. | |
95 | + * | |
96 | + * @param value allowed object is | |
97 | + * {@link String } | |
98 | + */ | |
99 | + public void setName(String value) | |
100 | + { | |
101 | + this.name = value; | |
102 | + } | |
108 | 103 | |
109 | 104 | /** |
110 | 105 | * <p>Java class for anonymous complex type. |
... | ... | @@ -125,18 +120,15 @@ public class Field { |
125 | 120 | @XmlAccessorType(XmlAccessType.FIELD) |
126 | 121 | @XmlType(name = "", propOrder = {"content"}) |
127 | 122 | public static class Value { |
128 | -// ------------------------------ FIELDS ------------------------------ | |
129 | 123 | |
130 | 124 | @XmlValue |
131 | 125 | protected String content; |
132 | 126 | |
133 | 127 | @XmlAttribute |
134 | - protected String role; | |
135 | - | |
136 | - @XmlAttribute | |
137 | 128 | protected String type; |
138 | 129 | |
139 | -// --------------------- GETTER / SETTER METHODS --------------------- | |
130 | + @XmlAttribute | |
131 | + protected String role; | |
140 | 132 | |
141 | 133 | /** |
142 | 134 | * Gets the value of the content property. |
... | ... | @@ -161,47 +153,47 @@ public class Field { |
161 | 153 | } |
162 | 154 | |
163 | 155 | /** |
164 | - * Gets the value of the role property. | |
156 | + * Gets the value of the type property. | |
165 | 157 | * |
166 | 158 | * @return possible object is |
167 | 159 | * {@link String } |
168 | 160 | */ |
169 | - public String getRole() | |
161 | + public String getType() | |
170 | 162 | { |
171 | - return role; | |
163 | + return type; | |
172 | 164 | } |
173 | 165 | |
174 | 166 | /** |
175 | - * Sets the value of the role property. | |
167 | + * Sets the value of the type property. | |
176 | 168 | * |
177 | 169 | * @param value allowed object is |
178 | 170 | * {@link String } |
179 | 171 | */ |
180 | - public void setRole(String value) | |
172 | + public void setType(String value) | |
181 | 173 | { |
182 | - this.role = value; | |
174 | + this.type = value; | |
183 | 175 | } |
184 | 176 | |
185 | 177 | /** |
186 | - * Gets the value of the type property. | |
178 | + * Gets the value of the role property. | |
187 | 179 | * |
188 | 180 | * @return possible object is |
189 | 181 | * {@link String } |
190 | 182 | */ |
191 | - public String getType() | |
183 | + public String getRole() | |
192 | 184 | { |
193 | - return type; | |
185 | + return role; | |
194 | 186 | } |
195 | 187 | |
196 | 188 | /** |
197 | - * Sets the value of the type property. | |
189 | + * Sets the value of the role property. | |
198 | 190 | * |
199 | 191 | * @param value allowed object is |
200 | 192 | * {@link String } |
201 | 193 | */ |
202 | - public void setType(String value) | |
194 | + public void setRole(String value) | |
203 | 195 | { |
204 | - this.type = value; | |
196 | + this.role = value; | |
205 | 197 | } |
206 | 198 | } |
207 | 199 | } | ... | ... |
... | ... | @@ -36,7 +36,6 @@ import java.util.List; |
36 | 36 | @XmlAccessorType(XmlAccessType.FIELD) |
37 | 37 | @XmlType(name = "issueType", propOrder = {"fieldOrComment"}) |
38 | 38 | public class Issue { |
39 | -// ------------------------------ FIELDS ------------------------------ | |
40 | 39 | |
41 | 40 | @XmlElements({@XmlElement(name = "comment", type = Comment.class), @XmlElement(name = "field", type = Field.class)}) |
42 | 41 | protected List<Object> fieldOrComment; |
... | ... | @@ -44,8 +43,6 @@ public class Issue { |
44 | 43 | @XmlAttribute |
45 | 44 | protected String id; |
46 | 45 | |
47 | -// --------------------- GETTER / SETTER METHODS --------------------- | |
48 | - | |
49 | 46 | /** |
50 | 47 | * Gets the value of the fieldOrComment property. |
51 | 48 | * <p/> | ... | ... |
... | ... | @@ -34,13 +34,10 @@ import java.util.List; |
34 | 34 | @XmlType(name = "", propOrder = {"issues"}) |
35 | 35 | @XmlRootElement(name = "issues") |
36 | 36 | public class Issues { |
37 | -// ------------------------------ FIELDS ------------------------------ | |
38 | 37 | |
39 | 38 | @XmlElement(name = "issue") |
40 | 39 | protected List<Issue> issues; |
41 | 40 | |
42 | -// --------------------- GETTER / SETTER METHODS --------------------- | |
43 | - | |
44 | 41 | /** |
45 | 42 | * Gets the value of the issues property. |
46 | 43 | * <p/> | ... | ... |
... | ... | @@ -13,7 +13,7 @@ import javax.xml.namespace.QName; |
13 | 13 | /** |
14 | 14 | * This object contains factory methods for each |
15 | 15 | * Java content interface and Java element interface |
16 | - * generated in the pl.it_crowd.youtrack.api.rest package. | |
16 | + * generated in the pl.itcrowd.youtrack.api.rest package. | |
17 | 17 | * <p>An ObjectFactory allows you to programatically |
18 | 18 | * construct new instances of the Java representation |
19 | 19 | * for XML content. The Java representation of XML |
... | ... | @@ -25,13 +25,6 @@ import javax.xml.namespace.QName; |
25 | 25 | */ |
26 | 26 | @XmlRegistry |
27 | 27 | public class ObjectFactory { |
28 | -// ------------------------------ FIELDS ------------------------------ | |
29 | - | |
30 | - private final static QName _CommentReplies_QNAME = new QName("", "replies"); | |
31 | - | |
32 | - private final static QName _CommentValue_QNAME = new QName("", "value"); | |
33 | - | |
34 | - private final static QName _Enumeration_QNAME = new QName("", "enumeration"); | |
35 | 28 | |
36 | 29 | private final static QName _Error_QNAME = new QName("", "error"); |
37 | 30 | |
... | ... | @@ -39,81 +32,89 @@ public class ObjectFactory { |
39 | 32 | |
40 | 33 | private final static QName _Issue_QNAME = new QName("", "issue"); |
41 | 34 | |
42 | -// --------------------------- CONSTRUCTORS --------------------------- | |
35 | + private final static QName _Enumeration_QNAME = new QName("", "enumeration"); | |
36 | + | |
37 | + private final static QName _CommentReplies_QNAME = new QName("", "replies"); | |
38 | + | |
39 | + private final static QName _CommentValue_QNAME = new QName("", "value"); | |
43 | 40 | |
44 | 41 | /** |
45 | - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: pl.it_crowd.youtrack.api.rest | |
42 | + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: pl.itcrowd.youtrack.api.rest | |
46 | 43 | */ |
47 | 44 | public ObjectFactory() |
48 | 45 | { |
49 | 46 | } |
50 | 47 | |
51 | -// -------------------------- OTHER METHODS -------------------------- | |
48 | + /** | |
49 | + * Create an instance of {@link Comment.Value } | |
50 | + */ | |
51 | + public Comment.Value createCommentValue() | |
52 | + { | |
53 | + return new Comment.Value(); | |
54 | + } | |
52 | 55 | |
53 | 56 | /** |
54 | - * Create an instance of {@link AssignedByType } | |
57 | + * Create an instance of {@link EnumerationValue } | |
55 | 58 | */ |
56 | - public AssignedByType createAssignedByType() | |
59 | + public EnumerationValue createEnumerationValue() | |
57 | 60 | { |
58 | - return new AssignedByType(); | |
61 | + return new EnumerationValue(); | |
59 | 62 | } |
60 | 63 | |
61 | 64 | /** |
62 | - * Create an instance of {@link AssigneeList } | |
65 | + * Create an instance of {@link Issue } | |
63 | 66 | */ |
64 | - public AssigneeList createAssigneeList() | |
67 | + public Issue createIssue() | |
65 | 68 | { |
66 | - return new AssigneeList(); | |
69 | + return new Issue(); | |
67 | 70 | } |
68 | 71 | |
69 | 72 | /** |
70 | - * Create an instance of {@link AssigneeList.Assignees } | |
73 | + * Create an instance of {@link UserRefs } | |
71 | 74 | */ |
72 | - public AssigneeList.Assignees createAssigneeListAssignees() | |
75 | + public UserRefs createUserRefs() | |
73 | 76 | { |
74 | - return new AssigneeList.Assignees(); | |
77 | + return new UserRefs(); | |
75 | 78 | } |
76 | 79 | |
77 | 80 | /** |
78 | - * Create an instance of {@link AssigneeType } | |
81 | + * Create an instance of {@link User } | |
79 | 82 | */ |
80 | - public AssigneeType createAssigneeType() | |
83 | + public User createUser() | |
81 | 84 | { |
82 | - return new AssigneeType(); | |
85 | + return new User(); | |
83 | 86 | } |
84 | 87 | |
85 | 88 | /** |
86 | - * Create an instance of {@link Comment } | |
89 | + * Create an instance of {@link Issues } | |
87 | 90 | */ |
88 | - public Comment createComment() | |
91 | + public Issues createIssues() | |
89 | 92 | { |
90 | - return new Comment(); | |
93 | + return new Issues(); | |
91 | 94 | } |
92 | 95 | |
93 | 96 | /** |
94 | - * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} | |
97 | + * Create an instance of {@link Field } | |
95 | 98 | */ |
96 | - @XmlElementDecl(namespace = "", name = "replies", scope = Comment.class) | |
97 | - public JAXBElement<String> createCommentReplies(String value) | |
99 | + public Field createField() | |
98 | 100 | { |
99 | - return new JAXBElement<String>(_CommentReplies_QNAME, String.class, Comment.class, value); | |
101 | + return new Field(); | |
100 | 102 | } |
101 | 103 | |
102 | 104 | /** |
103 | - * Create an instance of {@link Comment.Value } | |
105 | + * Create an instance of {@link Comment } | |
104 | 106 | */ |
105 | - public Comment.Value createCommentValue() | |
107 | + public Comment createComment() | |
106 | 108 | { |
107 | - return new Comment.Value(); | |
109 | + return new Comment(); | |
108 | 110 | } |
109 | 111 | |
110 | 112 | /** |
111 | - * Create an instance of {@link JAXBElement }{@code <}{@link Comment.Value }{@code >}} | |
113 | + * Create an instance of {@link AssigneeList.Assignees } | |
112 | 114 | */ |
113 | - @XmlElementDecl(namespace = "", name = "value", scope = Comment.class) | |
114 | - public JAXBElement<Comment.Value> createCommentValue(Comment.Value value) | |
115 | + public AssigneeList.Assignees createAssigneeListAssignees() | |
115 | 116 | { |
116 | - return new JAXBElement<Comment.Value>(_CommentValue_QNAME, Comment.Value.class, Comment.class, value); | |
117 | + return new AssigneeList.Assignees(); | |
117 | 118 | } |
118 | 119 | |
119 | 120 | /** |
... | ... | @@ -125,62 +126,61 @@ public class ObjectFactory { |
125 | 126 | } |
126 | 127 | |
127 | 128 | /** |
128 | - * Create an instance of {@link JAXBElement }{@code <}{@link Enumeration }{@code >}} | |
129 | + * Create an instance of {@link AssigneeList } | |
129 | 130 | */ |
130 | - @XmlElementDecl(namespace = "", name = "enumeration") | |
131 | - public JAXBElement<Enumeration> createEnumeration(Enumeration value) | |
131 | + public AssigneeList createAssigneeList() | |
132 | 132 | { |
133 | - return new JAXBElement<Enumeration>(_Enumeration_QNAME, Enumeration.class, null, value); | |
133 | + return new AssigneeList(); | |
134 | 134 | } |
135 | 135 | |
136 | 136 | /** |
137 | - * Create an instance of {@link EnumerationValue } | |
137 | + * Create an instance of {@link UserGroupRefType } | |
138 | 138 | */ |
139 | - public EnumerationValue createEnumerationValue() | |
139 | + public UserGroupRefType createUserGroupRefType() | |
140 | 140 | { |
141 | - return new EnumerationValue(); | |
141 | + return new UserGroupRefType(); | |
142 | 142 | } |
143 | 143 | |
144 | 144 | /** |
145 | - * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} | |
145 | + * Create an instance of {@link Field.Value } | |
146 | 146 | */ |
147 | - @XmlElementDecl(namespace = "", name = "error") | |
148 | - public JAXBElement<String> createError(String value) | |
147 | + public Field.Value createFieldValue() | |
149 | 148 | { |
150 | - return new JAXBElement<String>(_Error_QNAME, String.class, null, value); | |
149 | + return new Field.Value(); | |
151 | 150 | } |
152 | 151 | |
153 | 152 | /** |
154 | - * Create an instance of {@link Field } | |
153 | + * Create an instance of {@link AssignedByType } | |
155 | 154 | */ |
156 | - public Field createField() | |
155 | + public AssignedByType createAssignedByType() | |
157 | 156 | { |
158 | - return new Field(); | |
157 | + return new AssignedByType(); | |
159 | 158 | } |
160 | 159 | |
161 | 160 | /** |
162 | - * Create an instance of {@link Field.Value } | |
161 | + * Create an instance of {@link AssigneeType } | |
163 | 162 | */ |
164 | - public Field.Value createFieldValue() | |
163 | + public AssigneeType createAssigneeType() | |
165 | 164 | { |
166 | - return new Field.Value(); | |
165 | + return new AssigneeType(); | |
167 | 166 | } |
168 | 167 | |
169 | 168 | /** |
170 | - * Create an instance of {@link JAXBElement }{@code <}{@link Short }{@code >}} | |
169 | + * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} | |
171 | 170 | */ |
172 | - @XmlElementDecl(namespace = "", name = "int") | |
173 | - public JAXBElement<Short> createInt(Short value) | |
171 | + @XmlElementDecl(namespace = "", name = "error") | |
172 | + public JAXBElement<String> createError(String value) | |
174 | 173 | { |
175 | - return new JAXBElement<Short>(_Int_QNAME, Short.class, null, value); | |
174 | + return new JAXBElement<String>(_Error_QNAME, String.class, null, value); | |
176 | 175 | } |
177 | 176 | |
178 | 177 | /** |
179 | - * Create an instance of {@link Issue } | |
178 | + * Create an instance of {@link JAXBElement }{@code <}{@link Short }{@code >}} | |
180 | 179 | */ |
181 | - public Issue createIssue() | |
180 | + @XmlElementDecl(namespace = "", name = "int") | |
181 | + public JAXBElement<Short> createInt(Short value) | |
182 | 182 | { |
183 | - return new Issue(); | |
183 | + return new JAXBElement<Short>(_Int_QNAME, Short.class, null, value); | |
184 | 184 | } |
185 | 185 | |
186 | 186 | /** |
... | ... | @@ -193,34 +193,29 @@ public class ObjectFactory { |
193 | 193 | } |
194 | 194 | |
195 | 195 | /** |
196 | - * Create an instance of {@link Issues } | |
197 | - */ | |
198 | - public Issues createIssues() | |
199 | - { | |
200 | - return new Issues(); | |
201 | - } | |
202 | - | |
203 | - /** | |
204 | - * Create an instance of {@link User } | |
196 | + * Create an instance of {@link JAXBElement }{@code <}{@link Enumeration }{@code >}} | |
205 | 197 | */ |
206 | - public User createUser() | |
198 | + @XmlElementDecl(namespace = "", name = "enumeration") | |
199 | + public JAXBElement<Enumeration> createEnumeration(Enumeration value) | |
207 | 200 | { |
208 | - return new User(); | |
201 | + return new JAXBElement<Enumeration>(_Enumeration_QNAME, Enumeration.class, null, value); | |
209 | 202 | } |
210 | 203 | |
211 | 204 | /** |
212 | - * Create an instance of {@link UserGroupRefType } | |
205 | + * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} | |
213 | 206 | */ |
214 | - public UserGroupRefType createUserGroupRefType() | |
207 | + @XmlElementDecl(namespace = "", name = "replies", scope = Comment.class) | |
208 | + public JAXBElement<String> createCommentReplies(String value) | |
215 | 209 | { |
216 | - return new UserGroupRefType(); | |
210 | + return new JAXBElement<String>(_CommentReplies_QNAME, String.class, Comment.class, value); | |
217 | 211 | } |
218 | 212 | |
219 | 213 | /** |
220 | - * Create an instance of {@link UserRefs } | |
214 | + * Create an instance of {@link JAXBElement }{@code <}{@link Comment.Value }{@code >}} | |
221 | 215 | */ |
222 | - public UserRefs createUserRefs() | |
216 | + @XmlElementDecl(namespace = "", name = "value", scope = Comment.class) | |
217 | + public JAXBElement<Comment.Value> createCommentValue(Comment.Value value) | |
223 | 218 | { |
224 | - return new UserRefs(); | |
219 | + return new JAXBElement<Comment.Value>(_CommentValue_QNAME, Comment.Value.class, Comment.class, value); | |
225 | 220 | } |
226 | 221 | } | ... | ... |
... | ... | @@ -30,7 +30,6 @@ import javax.xml.bind.annotation.XmlType; |
30 | 30 | @XmlAccessorType(XmlAccessType.FIELD) |
31 | 31 | @XmlType(name = "userType") |
32 | 32 | public class User { |
33 | -// ------------------------------ FIELDS ------------------------------ | |
34 | 33 | |
35 | 34 | @XmlAttribute(required = true) |
36 | 35 | protected String login; |
... | ... | @@ -39,8 +38,6 @@ public class User { |
39 | 38 | @XmlSchemaType(name = "anyURI") |
40 | 39 | protected String url; |
41 | 40 | |
42 | -// --------------------- GETTER / SETTER METHODS --------------------- | |
43 | - | |
44 | 41 | /** |
45 | 42 | * Gets the value of the login property. |
46 | 43 | * | ... | ... |
... | ... | @@ -30,7 +30,9 @@ import javax.xml.bind.annotation.XmlValue; |
30 | 30 | @XmlAccessorType(XmlAccessType.FIELD) |
31 | 31 | @XmlType(name = "userGroupRefType", propOrder = {"value"}) |
32 | 32 | public class UserGroupRefType { |
33 | -// ------------------------------ FIELDS ------------------------------ | |
33 | + | |
34 | + @XmlValue | |
35 | + protected String value; | |
34 | 36 | |
35 | 37 | @XmlAttribute |
36 | 38 | protected String name; |
... | ... | @@ -38,74 +40,69 @@ public class UserGroupRefType { |
38 | 40 | @XmlAttribute |
39 | 41 | protected String url; |
40 | 42 | |
41 | - @XmlValue | |
42 | - protected String value; | |
43 | - | |
44 | -// --------------------- GETTER / SETTER METHODS --------------------- | |
45 | - | |
46 | 43 | /** |
47 | - * Gets the value of the name property. | |
44 | + * Gets the value of the value property. | |
48 | 45 | * |
49 | 46 | * @return possible object is |
50 | 47 | * {@link String } |
51 | 48 | */ |
52 | - public String getName() | |
49 | + public String getValue() | |
53 | 50 | { |
54 | - return name; | |
51 | + return value; | |
55 | 52 | } |
56 | 53 | |
57 | 54 | /** |
58 | - * Sets the value of the name property. | |
55 | + * Sets the value of the value property. | |
59 | 56 | * |
60 | 57 | * @param value allowed object is |
61 | 58 | * {@link String } |
62 | 59 | */ |
63 | - public void setName(String value) | |
60 | + public void setValue(String value) | |
64 | 61 | { |
65 | - this.name = value; | |
62 | + this.value = value; | |
66 | 63 | } |
67 | 64 | |
68 | 65 | /** |
69 | - * Gets the value of the url property. | |
66 | + * Gets the value of the name property. | |
70 | 67 | * |
71 | 68 | * @return possible object is |
72 | 69 | * {@link String } |
73 | 70 | */ |
74 | - public String getUrl() | |
71 | + public String getName() | |
75 | 72 | { |
76 | - return url; | |
73 | + return name; | |
77 | 74 | } |
78 | 75 | |
79 | 76 | /** |
80 | - * Sets the value of the url property. | |
77 | + * Sets the value of the name property. | |
81 | 78 | * |
82 | 79 | * @param value allowed object is |
83 | 80 | * {@link String } |
84 | 81 | */ |
85 | - public void setUrl(String value) | |
82 | + public void setName(String value) | |
86 | 83 | { |
87 | - this.url = value; | |
84 | + this.name = value; | |
88 | 85 | } |
89 | 86 | |
90 | 87 | /** |
91 | - * Gets the value of the value property. | |
88 | + * Gets the value of the url property. | |
92 | 89 | * |
93 | 90 | * @return possible object is |
94 | 91 | * {@link String } |
95 | 92 | */ |
96 | - public String getValue() | |
93 | + public String getUrl() | |
97 | 94 | { |
98 | - return value; | |
95 | + return url; | |
99 | 96 | } |
100 | 97 | |
101 | 98 | /** |
102 | - * Sets the value of the value property. | |
99 | + * Sets the value of the url property. | |
103 | 100 | * |
104 | 101 | * @param value allowed object is |
105 | 102 | * {@link String } |
106 | 103 | */ |
107 | - public void setValue(String value) | |
104 | + public void setUrl(String value) | |
108 | 105 | { |
109 | - this.value = value; | |
106 | + this.url = value; | |
110 | 107 | } |
111 | 108 | } | ... | ... |
... | ... | @@ -34,13 +34,10 @@ import java.util.List; |
34 | 34 | @XmlType(name = "", propOrder = {"users"}) |
35 | 35 | @XmlRootElement(name = "userRefs") |
36 | 36 | public class UserRefs { |
37 | -// ------------------------------ FIELDS ------------------------------ | |
38 | 37 | |
39 | 38 | @XmlElement(name = "user") |
40 | 39 | protected List<User> users; |
41 | 40 | |
42 | -// --------------------- GETTER / SETTER METHODS --------------------- | |
43 | - | |
44 | 41 | /** |
45 | 42 | * Gets the value of the users property. |
46 | 43 | * <p/> | ... | ... |
... | ... | @@ -11,7 +11,6 @@ import java.net.URISyntaxException; |
11 | 11 | import static org.junit.Assert.assertEquals; |
12 | 12 | |
13 | 13 | public class URIUtilsTest { |
14 | -// -------------------------- OTHER METHODS -------------------------- | |
15 | 14 | |
16 | 15 | @Test |
17 | 16 | public void buildURI() throws URISyntaxException | ... | ... |
... | ... | @@ -38,7 +38,6 @@ import static org.mockito.Mockito.when; |
38 | 38 | * Ticket TST-2 should be deleted. |
39 | 39 | */ |
40 | 40 | public class YoutrackAPITest { |
41 | -// -------------------------- OTHER METHODS -------------------------- | |
42 | 41 | |
43 | 42 | @Test |
44 | 43 | public void command() throws IOException, JAXBException | ... | ... |
Please
register
or
login
to post a comment