-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLatLongObject.java
More file actions
44 lines (35 loc) · 925 Bytes
/
LatLongObject.java
File metadata and controls
44 lines (35 loc) · 925 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
public class LatLongObject {
private String dispatchType;
private String latitude;
private String longitude;
public LatLongObject(String dispatchType, String latitude, String longitude) {
this.dispatchType = dispatchType;
this.latitude = latitude;
this.longitude = longitude;
}
public String getDispatchType() {
return dispatchType;
}
public String getLatitude() {
return latitude;
}
public String getLongitude() {
return longitude;
}
public String toString() {
return latitude + ", " + longitude;
}
public boolean equals(Object other) {
if (other == this) {
return true;
}
if (!(other instanceof LatLongObject)) {
return false;
}
LatLongObject castedOther = (LatLongObject)other;
return this.latitude.equals(castedOther.latitude) && this.longitude.equals(castedOther.longitude);
}
public int hashCode() {
return 31 * latitude.hashCode() + longitude.hashCode();
}
}