Last change
on this file since 10878 was 10125, checked in by Don-vip, 8 years ago |
refactor classes from corrector package, add javadoc
|
-
Property svn:eol-style
set to
native
|
File size:
1.3 KB
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.data.correction;
|
---|
3 |
|
---|
4 | /**
|
---|
5 | * Represents a change of a single tag.
|
---|
6 | * Both key and value can be subject of this change.
|
---|
7 | * @since 729
|
---|
8 | */
|
---|
9 | public class TagCorrection implements Correction {
|
---|
10 |
|
---|
11 | /** Old key */
|
---|
12 | public final String oldKey;
|
---|
13 | /** New key */
|
---|
14 | public final String newKey;
|
---|
15 | /** Old value */
|
---|
16 | public final String oldValue;
|
---|
17 | /** New value */
|
---|
18 | public final String newValue;
|
---|
19 |
|
---|
20 | /**
|
---|
21 | * Constructs a new {@code TagCorrection}.
|
---|
22 | * @param oldKey old key
|
---|
23 | * @param oldValue old value
|
---|
24 | * @param newKey new key
|
---|
25 | * @param newValue new value
|
---|
26 | */
|
---|
27 | public TagCorrection(String oldKey, String oldValue, String newKey, String newValue) {
|
---|
28 | this.oldKey = oldKey;
|
---|
29 | this.oldValue = oldValue;
|
---|
30 | this.newKey = newKey;
|
---|
31 | this.newValue = newValue;
|
---|
32 | }
|
---|
33 |
|
---|
34 | /**
|
---|
35 | * Determines if the key has changed.
|
---|
36 | * @return {@code true} if the key has changed
|
---|
37 | */
|
---|
38 | public boolean isKeyChanged() {
|
---|
39 | return !newKey.equals(oldKey);
|
---|
40 | }
|
---|
41 |
|
---|
42 | /**
|
---|
43 | * Determines if the value has changed.
|
---|
44 | * @return {@code true} if the value has changed
|
---|
45 | */
|
---|
46 | public boolean isValueChanged() {
|
---|
47 | return !newValue.equals(oldValue);
|
---|
48 | }
|
---|
49 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.