aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/model/CellTower.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-07-14 17:00:57 -0700
committerAnton Tananaev <anton@traccar.org>2022-07-14 17:00:57 -0700
commit0bd4c493e9003449457e87ebad6c7016ded71c8d (patch)
tree4beefd16bdc7665154d73fc07967ac45b1a06a49 /src/main/java/org/traccar/model/CellTower.java
parent34fefbffa49925a5d337ff388fb9db400d707f8b (diff)
downloadtrackermap-server-0bd4c493e9003449457e87ebad6c7016ded71c8d.tar.gz
trackermap-server-0bd4c493e9003449457e87ebad6c7016ded71c8d.tar.bz2
trackermap-server-0bd4c493e9003449457e87ebad6c7016ded71c8d.zip
Add LBS location caching (fix #3790)
Diffstat (limited to 'src/main/java/org/traccar/model/CellTower.java')
-rw-r--r--src/main/java/org/traccar/model/CellTower.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/model/CellTower.java b/src/main/java/org/traccar/model/CellTower.java
index 16a28ea79..bebbb2432 100644
--- a/src/main/java/org/traccar/model/CellTower.java
+++ b/src/main/java/org/traccar/model/CellTower.java
@@ -19,6 +19,8 @@ import com.fasterxml.jackson.annotation.JsonInclude;
import org.traccar.config.Config;
import org.traccar.config.Keys;
+import java.util.Objects;
+
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CellTower {
@@ -111,4 +113,22 @@ public class CellTower {
mobileNetworkCode = Integer.parseInt(operatorString.substring(3));
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ CellTower cellTower = (CellTower) o;
+ return Objects.equals(radioType, cellTower.radioType)
+ && Objects.equals(cellId, cellTower.cellId)
+ && Objects.equals(locationAreaCode, cellTower.locationAreaCode)
+ && Objects.equals(mobileCountryCode, cellTower.mobileCountryCode)
+ && Objects.equals(mobileNetworkCode, cellTower.mobileNetworkCode)
+ && Objects.equals(signalStrength, cellTower.signalStrength);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(radioType, cellId, locationAreaCode, mobileCountryCode, mobileNetworkCode, signalStrength);
+ }
+
}