1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.plugins.changes.issues;
20
21 import java.util.ArrayList;
22 import java.util.Iterator;
23 import java.util.List;
24 import java.util.Map;
25
26
27
28
29
30
31
32
33 public class IssuesReportHelper {
34 public static final int COLUMN_ASSIGNEE = 0;
35
36 public static final int COLUMN_COMPONENT = 1;
37
38 public static final int COLUMN_CREATED = 2;
39
40 public static final int COLUMN_FIX_VERSION = 3;
41
42 public static final int COLUMN_ID = 4;
43
44 public static final int COLUMN_KEY = 5;
45
46 public static final int COLUMN_PRIORITY = 6;
47
48 public static final int COLUMN_REPORTER = 7;
49
50 public static final int COLUMN_RESOLUTION = 8;
51
52 public static final int COLUMN_STATUS = 9;
53
54 public static final int COLUMN_SUMMARY = 10;
55
56 public static final int COLUMN_TYPE = 11;
57
58 public static final int COLUMN_UPDATED = 12;
59
60 public static final int COLUMN_VERSION = 13;
61
62
63
64
65
66
67
68
69 public static List<Integer> getColumnIds(String columnNames, Map<String, Integer> allColumns) {
70 List<Integer> columnIds = new ArrayList<>();
71 String[] columnNamesArray = columnNames.split(",");
72
73
74 for (String aColumnNamesArray : columnNamesArray) {
75 String columnName = aColumnNamesArray.trim();
76 if (allColumns.containsKey(columnName)) {
77 columnIds.add(allColumns.get(columnName));
78 }
79 }
80 return columnIds;
81 }
82
83
84
85
86
87
88
89 public static String printValues(List<String> values) {
90 StringBuilder sb = new StringBuilder();
91 if (values != null) {
92 Iterator<String> iterator = values.iterator();
93 while (iterator.hasNext()) {
94 String value = iterator.next();
95 sb.append(value);
96 if (iterator.hasNext()) {
97 sb.append(", ");
98 }
99 }
100 }
101 return sb.toString();
102 }
103 }