11package org .openstreetmap .atlas .checks .maproulette .data ;
22
3+ import static org .openstreetmap .atlas .checks .constants .CommonConstants .EMPTY_STRING ;
4+
35import java .util .ArrayList ;
46import java .util .HashSet ;
57import java .util .List ;
2628 */
2729public class Task
2830{
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-
5431 /**
5532 * Given some feature changes, convert them one by one to JSON cooperative challenge operations.
5633 * This is in {@link Task} since cooperativeWork objects are part of the Task geojson, and so
@@ -91,6 +68,31 @@ private List<JsonObject> convert()
9168 }
9269 }
9370
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+
9496 protected static final String FEATURE = "Feature" ;
9597 protected static final String POINT = "Point" ;
9698 protected static final String TASK_FEATURES = "features" ;
@@ -107,6 +109,7 @@ private List<JsonObject> convert()
107109 private static final String FRAMEWORK_GENERATOR = "flag:generator" ;
108110 private static final String FRAMEWORK = "Atlas Checks" ;
109111 private static final String COOPERATIVE_WORK = "cooperativeWork" ;
112+ private static final String ERROR_TAGS = "errorTags" ;
110113 private String challengeName ;
111114 private Optional <JsonArray > geoJson = Optional .empty ();
112115 private String instruction ;
@@ -156,6 +159,7 @@ public JsonObject generateTask(final long parentIdentifier)
156159 task .add (TASK_NAME , new JsonPrimitive (this .getTaskIdentifier ()));
157160 task .add (TASK_PARENT_ID , new JsonPrimitive (parentIdentifier ));
158161 task .add (TASK_GEOMETRIES , result );
162+ task .add (ERROR_TAGS , new JsonPrimitive (EMPTY_STRING ));
159163 return task ;
160164 }
161165
0 commit comments