Class CooperativeChallengeOperation
- java.lang.Object
-
- org.openstreetmap.atlas.checks.maproulette.data.cooperative_challenge.CooperativeChallengeOperation
-
- Direct Known Subclasses:
GeometryChangeOperation,TagChangeOperation
public abstract class CooperativeChallengeOperation extends java.lang.ObjectThis represents an operation that is embedded in a cooperative challenge. Example: Given a FeatureCollection geojson uploaded to MapRoulette:
For Tag changes:{ "type": "FeatureCollection", "features": [ ... ], // omitted for readability "cooperativeWork": { // special `cooperativeWork` property "meta": { "version": 2, // must be format version `2` "type": 1 // `1` for tag fix type }, "operations": [ // Operations section (see below) ... ] } }For geometry changes:{ "type": "FeatureCollection", "features": [ ... ], // omitted for readability "cooperativeWork": { // special `cooperativeWork` property "meta": { "version": 2, // must be format version `2` "type": 2 // `2` for change file type }, "file": { // Operations section (see below) "type": "xml", // only xml is supported at this time "format": "osc", // only osc is supported at this time "encoding": "base64", // only base64 is supported at this time "content": "..." // The base64 encoded OSC file } } }This class is an abstract representation of the json material to be found under "operations". Its subclasses should handle the various ChangeDescriptor types, including GeometryChangeDescriptor, LongElementChangeDescriptor, RelationMemberChangeDescriptor, TagChangeDescriptor
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringDATA_KEYprotected static java.lang.StringID_KEYprotected static java.lang.StringOPERATION_KEYprotected static java.lang.StringOPERATION_TYPE_KEYprotected static java.lang.StringOPERATIONS_KEY
-
Constructor Summary
Constructors Modifier Constructor Description protectedCooperativeChallengeOperation(org.openstreetmap.atlas.geography.atlas.change.description.ChangeDescription changeDescription)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract CooperativeChallengeOperationcreate()static java.lang.Class<? extends CooperativeChallengeOperation>getAppropriateChangeOperation(org.openstreetmap.atlas.geography.atlas.change.description.ChangeDescription changeDescription)Get the appropriate change operation classprotected java.util.List<org.openstreetmap.atlas.geography.atlas.change.description.descriptors.ChangeDescriptor>getChangeDescriptorList()protected java.lang.StringgetIdentifier()com.google.gson.JsonObjectgetJson()protected org.openstreetmap.atlas.geography.atlas.change.description.ChangeDescriptorTypegetOperationType()protected abstract java.util.function.Predicate<org.openstreetmap.atlas.geography.atlas.change.description.descriptors.ChangeDescriptor>operationFilter()protected voidsetJson(com.google.gson.JsonObject json)
-
-
-
Field Detail
-
OPERATION_TYPE_KEY
protected static final java.lang.String OPERATION_TYPE_KEY
- See Also:
- Constant Field Values
-
DATA_KEY
protected static final java.lang.String DATA_KEY
- See Also:
- Constant Field Values
-
ID_KEY
protected static final java.lang.String ID_KEY
- See Also:
- Constant Field Values
-
OPERATIONS_KEY
protected static final java.lang.String OPERATIONS_KEY
- See Also:
- Constant Field Values
-
OPERATION_KEY
protected static final java.lang.String OPERATION_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAppropriateChangeOperation
public static java.lang.Class<? extends CooperativeChallengeOperation> getAppropriateChangeOperation(org.openstreetmap.atlas.geography.atlas.change.description.ChangeDescription changeDescription)
Get the appropriate change operation class- Parameters:
changeDescription- The change descriptor- Returns:
- A class appropriate for the change descriptor
-
create
public abstract CooperativeChallengeOperation create()
-
getJson
public com.google.gson.JsonObject getJson()
-
getChangeDescriptorList
protected java.util.List<org.openstreetmap.atlas.geography.atlas.change.description.descriptors.ChangeDescriptor> getChangeDescriptorList()
-
getIdentifier
protected java.lang.String getIdentifier()
-
getOperationType
protected org.openstreetmap.atlas.geography.atlas.change.description.ChangeDescriptorType getOperationType()
-
operationFilter
protected abstract java.util.function.Predicate<org.openstreetmap.atlas.geography.atlas.change.description.descriptors.ChangeDescriptor> operationFilter()
-
setJson
protected void setJson(com.google.gson.JsonObject json)
-
-