1
1
package org .openstreetmap .atlas .checks .maproulette .data ;
2
2
3
+ import static org .openstreetmap .atlas .checks .constants .CommonConstants .EMPTY_STRING ;
4
+
3
5
import java .util .ArrayList ;
4
6
import java .util .HashSet ;
5
7
import java .util .List ;
26
28
*/
27
29
public class Task
28
30
{
29
- /**
30
- * A class holding a point and some description for that point
31
- */
32
- private class PointInformation
33
- {
34
- private final Location location ;
35
- private final Optional <String > description ;
36
-
37
- PointInformation (final Location location , final Optional <String > description )
38
- {
39
- this .location = location ;
40
- this .description = description ;
41
- }
42
-
43
- public Optional <String > getDescription ()
44
- {
45
- return this .description ;
46
- }
47
-
48
- public Location getLocation ()
49
- {
50
- return this .location ;
51
- }
52
- }
53
-
54
31
/**
55
32
* Given some feature changes, convert them one by one to JSON cooperative challenge operations.
56
33
* This is in {@link Task} since cooperativeWork objects are part of the Task geojson, and so
@@ -91,6 +68,31 @@ private List<JsonObject> convert()
91
68
}
92
69
}
93
70
71
+ /**
72
+ * A class holding a point and some description for that point
73
+ */
74
+ private class PointInformation
75
+ {
76
+ private final Location location ;
77
+ private final Optional <String > description ;
78
+
79
+ PointInformation (final Location location , final Optional <String > description )
80
+ {
81
+ this .location = location ;
82
+ this .description = description ;
83
+ }
84
+
85
+ public Optional <String > getDescription ()
86
+ {
87
+ return this .description ;
88
+ }
89
+
90
+ public Location getLocation ()
91
+ {
92
+ return this .location ;
93
+ }
94
+ }
95
+
94
96
protected static final String FEATURE = "Feature" ;
95
97
protected static final String POINT = "Point" ;
96
98
protected static final String TASK_FEATURES = "features" ;
@@ -107,6 +109,7 @@ private List<JsonObject> convert()
107
109
private static final String FRAMEWORK_GENERATOR = "flag:generator" ;
108
110
private static final String FRAMEWORK = "Atlas Checks" ;
109
111
private static final String COOPERATIVE_WORK = "cooperativeWork" ;
112
+ private static final String ERROR_TAGS = "errorTags" ;
110
113
private String challengeName ;
111
114
private Optional <JsonArray > geoJson = Optional .empty ();
112
115
private String instruction ;
@@ -156,6 +159,7 @@ public JsonObject generateTask(final long parentIdentifier)
156
159
task .add (TASK_NAME , new JsonPrimitive (this .getTaskIdentifier ()));
157
160
task .add (TASK_PARENT_ID , new JsonPrimitive (parentIdentifier ));
158
161
task .add (TASK_GEOMETRIES , result );
162
+ task .add (ERROR_TAGS , new JsonPrimitive (EMPTY_STRING ));
159
163
return task ;
160
164
}
161
165
0 commit comments