Skip to content

Commit dcce306

Browse files
committed
Renamed property mapcode to mapcodePrecision0 within class
1 parent 64ab536 commit dcce306

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/main/java/com/mapcode/Mapcode.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* territory definition.
2525
*/
2626
public final class Mapcode {
27-
@Nonnull private final String mapcode;
27+
@Nonnull private final String mapcodePrecision0;
2828
@Nonnull private final String mapcodePrecision1;
2929
@Nonnull private final String mapcodePrecision2;
3030
@Nonnull private final Territory territory;
@@ -34,11 +34,11 @@ public Mapcode(
3434
@Nonnull final Territory territory) {
3535
this.mapcodePrecision2 = mapcode;
3636
if (mapcode.contains("-")) {
37-
this.mapcode = mapcode.substring(0, mapcode.length() - 3);
37+
this.mapcodePrecision0 = mapcode.substring(0, mapcode.length() - 3);
3838
this.mapcodePrecision1 = mapcode.substring(0, mapcode.length() - 1);
3939
}
4040
else {
41-
this.mapcode = mapcode;
41+
this.mapcodePrecision0 = mapcode;
4242
this.mapcodePrecision1 = mapcode;
4343
}
4444
this.territory = territory;
@@ -56,7 +56,7 @@ public Mapcode(
5656
*/
5757
@Nonnull
5858
public String getMapcode() {
59-
return mapcode;
59+
return mapcodePrecision0;
6060
}
6161

6262
/**
@@ -66,7 +66,7 @@ public String getMapcode() {
6666
*/
6767
@Nonnull
6868
public String getMapcodePrecision0() {
69-
return mapcode;
69+
return mapcodePrecision0;
7070
}
7171

7272
/**
@@ -131,7 +131,7 @@ public Territory getTerritory() {
131131

132132
@Override
133133
public int hashCode() {
134-
return Arrays.deepHashCode(new Object[]{mapcode, territory});
134+
return Arrays.deepHashCode(new Object[]{mapcodePrecision0, territory});
135135
}
136136

137137
/**
@@ -144,7 +144,7 @@ public int hashCode() {
144144
*/
145145
@Nonnull
146146
public String asLocal() {
147-
return mapcode;
147+
return mapcodePrecision0;
148148
}
149149

150150
/**
@@ -160,7 +160,7 @@ public String asLocal() {
160160
*/
161161
@Nonnull
162162
public String asInternationalFullName() {
163-
return territory.getFullName() + ' ' + mapcode;
163+
return territory.getFullName() + ' ' + mapcodePrecision0;
164164
}
165165

166166
/**
@@ -177,7 +177,7 @@ public String asInternationalFullName() {
177177
*/
178178
@Nonnull
179179
public String asInternationalISO() {
180-
return territory.toString() + ' ' + mapcode;
180+
return territory.toString() + ' ' + mapcodePrecision0;
181181
}
182182

183183
@Nonnull
@@ -195,6 +195,6 @@ public boolean equals(final Object obj) {
195195
return false;
196196
}
197197
final Mapcode that = (Mapcode) obj;
198-
return mapcode.equals(that.mapcode) && (this.territory.equals(that.territory));
198+
return mapcodePrecision0.equals(that.mapcodePrecision0) && (this.territory.equals(that.territory));
199199
}
200200
}

0 commit comments

Comments
 (0)