source: josm/trunk/src/org/openstreetmap/josm/data/conflict/PropertyConflict.java@ 1169

Last change on this file since 1169 was 1169, checked in by stoecker, 15 years ago

removed usage of tab stops

  • Property svn:eol-style set to native
File size: 854 bytes
Line 
1// License: GPL. Copyright 2007 by Immanuel Scholz and others
2package org.openstreetmap.josm.data.conflict;
3
4import org.openstreetmap.josm.data.osm.OsmPrimitive;
5
6public class PropertyConflict extends ConflictItem {
7 private String key;
8
9 public PropertyConflict(String key) {
10 this.key = key;
11 }
12
13 @Override public boolean hasConflict(OsmPrimitive key, OsmPrimitive value) {
14 String k = key.get(this.key);
15 String v = value.get(this.key);
16 return k == null ? v!=null : !k.equals(v);
17 }
18
19 @Override protected String str(OsmPrimitive osm) {
20 String v = osm.get(key);
21 return v == null ? "" : v;
22 }
23
24 @Override public String key() {
25 return "key|"+key;
26 }
27
28 @Override public void apply(OsmPrimitive target, OsmPrimitive other) {
29 target.put(key, other.get(key));
30 }
31}
Note: See TracBrowser for help on using the repository browser.