public class TagMergeItem extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
key |
private MergeDecisionType |
mergeDecision |
private java.lang.String |
myTagValue |
private java.lang.String |
theirTagValue |
Constructor and Description |
---|
TagMergeItem(java.lang.String key,
OsmPrimitive my,
OsmPrimitive their)
constructor
|
TagMergeItem(java.lang.String key,
java.lang.String myTagValue,
java.lang.String theirTagValue)
constructor
|
Modifier and Type | Method and Description |
---|---|
void |
applyToMyPrimitive(OsmPrimitive primitive)
applies the current merge decisions to the tag set of an OSM primitive.
|
void |
decide(MergeDecisionType decision)
applies a merge decision to this merge item
|
java.lang.String |
getKey() |
MergeDecisionType |
getMergeDecision() |
java.lang.String |
getMyTagValue() |
java.lang.String |
getTheirTagValue() |
private final java.lang.String key
private final java.lang.String myTagValue
private final java.lang.String theirTagValue
private MergeDecisionType mergeDecision
public TagMergeItem(java.lang.String key, java.lang.String myTagValue, java.lang.String theirTagValue)
key
- the common tag key. Must not be null.myTagValue
- the value for this key known in the local datasettheirTagValue
- the value for this key known in the dataset on the serverjava.lang.IllegalArgumentException
- if key is nullpublic TagMergeItem(java.lang.String key, OsmPrimitive my, OsmPrimitive their)
key
- the tag key common to the merged OSM primitives. Must not be null.my
- my version of the OSM primitive (i.e. the version known in the local dataset). Must not be null.their
- their version of the OSM primitive (i.e. the version known on the server). Must not be null.java.lang.IllegalArgumentException
- if key is nulljava.lang.IllegalArgumentException
- if my is nulljava.lang.IllegalArgumentException
- if their is nullpublic void decide(MergeDecisionType decision)
decision
- the merge decision. Must not be null.java.lang.IllegalArgumentException
- if decision is nullpublic java.lang.String getKey()
public java.lang.String getMyTagValue()
public java.lang.String getTheirTagValue()
public MergeDecisionType getMergeDecision()
public void applyToMyPrimitive(OsmPrimitive primitive)
primitive
- the OSM primitive. Must not be null.java.lang.IllegalArgumentException
- if primitive is nulljava.lang.IllegalStateException
- if this merge item is undecided