Class TagMergeItem
- java.lang.Object
-
- org.openstreetmap.josm.gui.conflict.pair.tags.TagMergeItem
-
public class TagMergeItem extends Object
TagMergeItem represents an individual merge action for a specific pair of key/value. A TagMergeItem manages the values of the two key/value-pairs and keeps track of the applied merge decision.
-
-
Field Summary
Fields Modifier and Type Field Description private String
key
private MergeDecisionType
mergeDecision
private String
myTagValue
private String
theirTagValue
-
Constructor Summary
Constructors Constructor Description TagMergeItem(String key, String myTagValue, String theirTagValue)
constructorTagMergeItem(String key, OsmPrimitive my, OsmPrimitive their)
constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 itemString
getKey()
MergeDecisionType
getMergeDecision()
String
getMyTagValue()
String
getTheirTagValue()
-
-
-
Field Detail
-
myTagValue
private final String myTagValue
-
theirTagValue
private final String theirTagValue
-
mergeDecision
private MergeDecisionType mergeDecision
-
-
Constructor Detail
-
TagMergeItem
public TagMergeItem(String key, String myTagValue, String theirTagValue)
constructor- Parameters:
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 server- Throws:
IllegalArgumentException
- if key is null
-
TagMergeItem
public TagMergeItem(String key, OsmPrimitive my, OsmPrimitive their)
constructor- Parameters:
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.- Throws:
IllegalArgumentException
- if key is nullIllegalArgumentException
- if my is nullIllegalArgumentException
- if their is null
-
-
Method Detail
-
decide
public void decide(MergeDecisionType decision)
applies a merge decision to this merge item- Parameters:
decision
- the merge decision. Must not be null.- Throws:
IllegalArgumentException
- if decision is null
-
getMyTagValue
public String getMyTagValue()
-
getTheirTagValue
public String getTheirTagValue()
-
getMergeDecision
public MergeDecisionType getMergeDecision()
-
applyToMyPrimitive
public void applyToMyPrimitive(OsmPrimitive primitive)
applies the current merge decisions to the tag set of an OSM primitive. The OSM primitive has the role of primitive in the local dataset ('my' primitive, not 'their' primitive)- Parameters:
primitive
- the OSM primitive. Must not be null.- Throws:
IllegalArgumentException
- if primitive is nullIllegalStateException
- if this merge item is undecided
-
-