diff --git a/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/BaseFeatureCollection.java b/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/BaseFeatureCollection.java index 3b249089d..1df84c444 100644 --- a/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/BaseFeatureCollection.java +++ b/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/BaseFeatureCollection.java @@ -56,4 +56,30 @@ public String toJson() { return gson.create().toJson(this); } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + BaseFeatureCollection that = (BaseFeatureCollection) o; + + return type.equals(that.type); + + } + + @Override + public int hashCode() { + return type.hashCode(); + } + + @Override + public String toString() { + return "BaseFeatureCollection{" + + "type='" + type + '\'' + + '}'; + } } diff --git a/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/Feature.java b/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/Feature.java index d19ec4bc2..f277727de 100644 --- a/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/Feature.java +++ b/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/Feature.java @@ -296,4 +296,41 @@ public boolean hasProperty(String key) { public boolean hasNonNullValueForProperty(String key) { return hasProperty(key) && !getProperty(key).isJsonNull(); } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + Feature feature = (Feature) o; + + if (!type.equals(feature.type)) { + return false; + } + if (geometry != null ? !geometry.equals(feature.geometry) : feature.geometry != null) { + return false; + } + if (properties != null ? !properties.equals(feature.properties) : feature.properties != null) { + return false; + } + return id != null ? id.equals(feature.id) : feature.id == null; + } + + @Override + public int hashCode() { + int result = type.hashCode(); + result = 31 * result + (geometry != null ? geometry.hashCode() : 0); + result = 31 * result + (properties != null ? properties.hashCode() : 0); + result = 31 * result + (id != null ? id.hashCode() : 0); + return result; + } + + @Override + public String toString() { + return this.toJson(); + } } diff --git a/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/FeatureCollection.java b/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/FeatureCollection.java index b4d667af2..d2833ae70 100644 --- a/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/FeatureCollection.java +++ b/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/FeatureCollection.java @@ -47,8 +47,43 @@ public static FeatureCollection fromFeatures(List features) { return new FeatureCollection(features); } + /** + * Create a {@link FeatureCollection} from an array of features. + * + * @param features Array of {@link Feature} + * @return new {@link FeatureCollection} + * @since 1.0.0 + */ public static FeatureCollection fromFeatures(Feature[] features) { return new FeatureCollection(Arrays.asList(features)); } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } + + FeatureCollection that = (FeatureCollection) o; + + return features != null ? features.equals(that.features) : that.features == null; + } + + @Override + public int hashCode() { + int result = super.hashCode(); + result = 31 * result + (features != null ? features.hashCode() : 0); + return result; + } + + @Override + public String toString() { + return this.toJson(); + } } diff --git a/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/GeometryCollection.java b/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/GeometryCollection.java index a7791bfef..6e6fc0f97 100644 --- a/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/GeometryCollection.java +++ b/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/GeometryCollection.java @@ -88,4 +88,33 @@ public String toJson() { gson.registerTypeAdapter(Position.class, new PositionSerializer()); return gson.create().toJson(this); } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + GeometryCollection that = (GeometryCollection) o; + + if (!type.equals(that.type)) { + return false; + } + return geometries != null ? geometries.equals(that.geometries) : that.geometries == null; + } + + @Override + public int hashCode() { + int result = type.hashCode(); + result = 31 * result + (geometries != null ? geometries.hashCode() : 0); + return result; + } + + @Override + public String toString() { + return this.toJson(); + } } diff --git a/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/LineString.java b/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/LineString.java index 382843f79..b478b822f 100644 --- a/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/LineString.java +++ b/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/LineString.java @@ -125,4 +125,33 @@ public static LineString fromPolyline(String polyline, int precision) { public String toPolyline(int precision) { return PolylineUtils.encode(getCoordinates(), precision); } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + LineString that = (LineString) o; + + if (!type.equals(that.type)) { + return false; + } + return coordinates != null ? coordinates.equals(that.coordinates) : that.coordinates == null; + } + + @Override + public int hashCode() { + int result = type.hashCode(); + result = 31 * result + (coordinates != null ? coordinates.hashCode() : 0); + return result; + } + + @Override + public String toString() { + return this.toJson(); + } } diff --git a/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/MultiLineString.java b/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/MultiLineString.java index bd909341a..9e7b55789 100644 --- a/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/MultiLineString.java +++ b/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/MultiLineString.java @@ -105,4 +105,33 @@ public String toJson() { gson.registerTypeAdapter(Position.class, new PositionSerializer()); return gson.create().toJson(this); } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + MultiLineString that = (MultiLineString) o; + + if (!type.equals(that.type)) { + return false; + } + return coordinates != null ? coordinates.equals(that.coordinates) : that.coordinates == null; + } + + @Override + public int hashCode() { + int result = type.hashCode(); + result = 31 * result + (coordinates != null ? coordinates.hashCode() : 0); + return result; + } + + @Override + public String toString() { + return this.toJson(); + } } diff --git a/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/MultiPoint.java b/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/MultiPoint.java index 985260209..de4c861c2 100644 --- a/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/MultiPoint.java +++ b/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/MultiPoint.java @@ -101,4 +101,34 @@ public String toJson() { gson.registerTypeAdapter(Position.class, new PositionSerializer()); return gson.create().toJson(this); } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + MultiPoint that = (MultiPoint) o; + + if (!type.equals(that.type)) { + return false; + } + return coordinates != null ? coordinates.equals(that.coordinates) : that.coordinates == null; + + } + + @Override + public int hashCode() { + int result = type.hashCode(); + result = 31 * result + (coordinates != null ? coordinates.hashCode() : 0); + return result; + } + + @Override + public String toString() { + return this.toJson(); + } } diff --git a/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/MultiPolygon.java b/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/MultiPolygon.java index 59b2c166f..6b4481485 100644 --- a/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/MultiPolygon.java +++ b/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/MultiPolygon.java @@ -109,4 +109,33 @@ public String toJson() { gson.registerTypeAdapter(Position.class, new PositionSerializer()); return gson.create().toJson(this); } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + MultiPolygon that = (MultiPolygon) o; + + if (!type.equals(that.type)) { + return false; + } + return coordinates != null ? coordinates.equals(that.coordinates) : that.coordinates == null; + } + + @Override + public int hashCode() { + int result = type.hashCode(); + result = 31 * result + (coordinates != null ? coordinates.hashCode() : 0); + return result; + } + + @Override + public String toString() { + return this.toJson(); + } } diff --git a/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/Point.java b/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/Point.java index 305a7da90..ade8020b8 100644 --- a/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/Point.java +++ b/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/Point.java @@ -115,9 +115,6 @@ public int hashCode() { @Override public String toString() { - return "Point{" - + "type='" + type + '\'' - + ", coordinates=" + coordinates - + '}'; + return this.toJson(); } } \ No newline at end of file diff --git a/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/Polygon.java b/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/Polygon.java index 769ebd85b..5f5b89ea8 100644 --- a/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/Polygon.java +++ b/mapbox/libjava-geojson/src/main/java/com/mapbox/services/commons/geojson/Polygon.java @@ -105,4 +105,33 @@ public String toJson() { gson.registerTypeAdapter(Position.class, new PositionSerializer()); return gson.create().toJson(this); } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + Polygon polygon = (Polygon) o; + + if (!type.equals(polygon.type)) { + return false; + } + return coordinates != null ? coordinates.equals(polygon.coordinates) : polygon.coordinates == null; + } + + @Override + public int hashCode() { + int result = type.hashCode(); + result = 31 * result + (coordinates != null ? coordinates.hashCode() : 0); + return result; + } + + @Override + public String toString() { + return this.toJson(); + } } diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/DirectionsResponse.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/DirectionsResponse.java index ec6629991..2f5a436ed 100644 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/DirectionsResponse.java +++ b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/DirectionsResponse.java @@ -103,4 +103,43 @@ public List getRoutes() { public void setRoutes(List routes) { this.routes = routes; } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + DirectionsResponse response = (DirectionsResponse) o; + + if (getCode() != null ? !getCode().equals(response.getCode()) : response.getCode() != null) { + return false; + } + if (getRoutes() != null ? !getRoutes().equals(response.getRoutes()) : response.getRoutes() != null) { + return false; + } + return getWaypoints() != null ? getWaypoints().equals(response.getWaypoints()) : response.getWaypoints() == null; + + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (getCode() != null ? getCode().hashCode() : 0); + result = 31 * result + (getRoutes() != null ? getRoutes().hashCode() : 0); + result = 31 * result + (getWaypoints() != null ? getWaypoints().hashCode() : 0); + return result; + } + + @Override + public String toString() { + return "DirectionsResponse{" + + "code='" + code + '\'' + + ", routes=" + routes + + ", waypoints=" + waypoints + + '}'; + } } diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/DirectionsRoute.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/DirectionsRoute.java index 2a8db9051..d4dc42d6b 100644 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/DirectionsRoute.java +++ b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/DirectionsRoute.java @@ -147,4 +147,58 @@ public List getLegs() { public void setLegs(List legs) { this.legs = legs; } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + DirectionsRoute that = (DirectionsRoute) o; + + if (Double.compare(that.getDistance(), getDistance()) != 0) { + return false; + } + if (Double.compare(that.getDuration(), getDuration()) != 0) { + return false; + } + if (Double.compare(that.getWeight(), getWeight()) != 0) { + return false; + } + if (getGeometry() != null ? !getGeometry().equals(that.getGeometry()) : that.getGeometry() != null) { + return false; + } + if (getWeightName() != null ? !getWeightName().equals(that.getWeightName()) : that.getWeightName() != null) { + return false; + } + return getLegs() != null ? getLegs().equals(that.getLegs()) : that.getLegs() == null; + + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Double.valueOf(getDistance()).hashCode(); + result = 31 * result + Double.valueOf(getDuration()).hashCode(); + result = 31 * result + (getGeometry() != null ? getGeometry().hashCode() : 0); + result = 31 * result + Double.valueOf(getWeight()).hashCode(); + result = 31 * result + (getWeightName() != null ? getWeightName().hashCode() : 0); + result = 31 * result + (getLegs() != null ? getLegs().hashCode() : 0); + return result; + } + + @Override + public String toString() { + return "DirectionsRoute{" + + "distance=" + distance + + ", duration=" + duration + + ", geometry='" + geometry + '\'' + + ", weight=" + weight + + ", weightName='" + weightName + '\'' + + ", legs=" + legs + + '}'; + } } diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/DirectionsWaypoint.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/DirectionsWaypoint.java index a3c8ffdbf..27a1bf5f9 100644 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/DirectionsWaypoint.java +++ b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/DirectionsWaypoint.java @@ -2,6 +2,8 @@ import com.mapbox.services.commons.models.Position; +import java.util.Arrays; + /** * An input coordinate snapped to the roads network. * @@ -70,4 +72,38 @@ public void setLocation(double[] location) { public Position asPosition() { return Position.fromCoordinates(location[0], location[1]); } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + DirectionsWaypoint that = (DirectionsWaypoint) o; + + if (getName() != null ? !getName().equals(that.getName()) : that.getName() != null) { + return false; + } + return Arrays.equals(getLocation(), that.getLocation()); + + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (getName() != null ? getName().hashCode() : 0); + result = 31 * result + Arrays.hashCode(getLocation()); + return result; + } + + @Override + public String toString() { + return "DirectionsWaypoint{" + + "name='" + name + '\'' + + ", location=" + Arrays.toString(location) + + '}'; + } } diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/IntersectionLanes.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/IntersectionLanes.java index 40b9b84c8..552e8d615 100644 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/IntersectionLanes.java +++ b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/IntersectionLanes.java @@ -1,5 +1,7 @@ package com.mapbox.services.api.directions.v5.models; +import java.util.Arrays; + /** * Object representing lanes in an intersection. * @@ -76,4 +78,37 @@ public String[] getIndications() { public void setIndications(String[] indications) { this.indications = indications; } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + IntersectionLanes that = (IntersectionLanes) o; + + if (getValid() != that.getValid()) { + return false; + } + return !(getIndications() != null ? !Arrays.equals(getIndications(), + that.getIndications()) : that.getIndications() != null); + } + + @Override + public int hashCode() { + int result = (getValid() ? 1 : 0); + result = 31 * result + Arrays.hashCode(getIndications()); + return result; + } + + @Override + public String toString() { + return "IntersectionLanes{" + + "valid=" + valid + + ", indications=" + Arrays.toString(indications) + + '}'; + } } diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/LegAnnotation.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/LegAnnotation.java index f1c8eb6f7..ecc83e69e 100644 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/LegAnnotation.java +++ b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/LegAnnotation.java @@ -1,5 +1,7 @@ package com.mapbox.services.api.directions.v5.models; +import java.util.Arrays; + /** * An annotations object that contains additional details about each line segment along the route geometry. Each entry * in an annotations field corresponds to a coordinate along the route geometry. @@ -98,4 +100,47 @@ public String[] getCongestion() { public void setCongestion(String[] congestion) { this.congestion = congestion; } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + LegAnnotation that = (LegAnnotation) o; + + if (!Arrays.equals(getDistance(), that.getDistance())) { + return false; + } + if (!Arrays.equals(getDuration(), that.getDuration())) { + return false; + } + if (!Arrays.equals(getSpeed(), that.getSpeed())) { + return false; + } + return Arrays.equals(getCongestion(), that.getCongestion()); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Arrays.hashCode(getDistance()); + result = 31 * result + Arrays.hashCode(getDuration()); + result = 31 * result + Arrays.hashCode(getSpeed()); + result = 31 * result + Arrays.hashCode(getCongestion()); + return result; + } + + @Override + public String toString() { + return "LegAnnotation{" + + "distance=" + Arrays.toString(distance) + + ", duration=" + Arrays.toString(duration) + + ", speed=" + Arrays.toString(speed) + + ", congestion=" + Arrays.toString(congestion) + + '}'; + } } diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/LegStep.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/LegStep.java index 771d7af04..4e1c76fc5 100644 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/LegStep.java +++ b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/LegStep.java @@ -325,4 +325,100 @@ public String getPronunciation() { public void setPronunciation(String pronunciation) { this.pronunciation = pronunciation; } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + LegStep legStep = (LegStep) o; + + if (Double.compare(legStep.getDistance(), getDistance()) != 0) { + return false; + } + if (Double.compare(legStep.getDuration(), getDuration()) != 0) { + return false; + } + if (Double.compare(legStep.getWeight(), getWeight()) != 0) { + return false; + } + if (getGeometry() != null ? !getGeometry().equals(legStep.getGeometry()) : legStep.getGeometry() != null) { + return false; + } + if (getName() != null ? !getName().equals(legStep.getName()) : legStep.getName() != null) { + return false; + } + if (getRef() != null ? !getRef().equals(legStep.getRef()) : legStep.getRef() != null) { + return false; + } + if (getDestinations() != null + ? !getDestinations().equals(legStep.getDestinations()) : legStep.getDestinations() != null) { + return false; + } + if (getMode() != null + ? !getMode().equals(legStep.getMode()) : legStep.getMode() != null) { + return false; + } + if (getPronunciation() != null + ? !getPronunciation().equals(legStep.getPronunciation()) : legStep.getPronunciation() != null) { + return false; + } + if (getRotaryName() != null + ? !getRotaryName().equals(legStep.getRotaryName()) : legStep.getRotaryName() != null) { + return false; + } + if (getRotaryPronunciation() != null + ? !getRotaryPronunciation().equals(legStep.getRotaryPronunciation()) : legStep.getRotaryPronunciation() != null) { + return false; + } + if (getManeuver() != null + ? !getManeuver().equals(legStep.getManeuver()) : legStep.getManeuver() != null) { + return false; + } + return getIntersections() != null + ? getIntersections().equals(legStep.getIntersections()) : legStep.getIntersections() == null; + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Double.valueOf(getDistance()).hashCode(); + result = 31 * result + Double.valueOf(getDuration()).hashCode(); + result = 31 * result + (getGeometry() != null ? getGeometry().hashCode() : 0); + result = 31 * result + (getName() != null ? getName().hashCode() : 0); + result = 31 * result + (getRef() != null ? getRef().hashCode() : 0); + result = 31 * result + (getDestinations() != null ? getDestinations().hashCode() : 0); + result = 31 * result + (getMode() != null ? getMode().hashCode() : 0); + result = 31 * result + (getPronunciation() != null ? getPronunciation().hashCode() : 0); + result = 31 * result + (getRotaryName() != null ? getRotaryName().hashCode() : 0); + result = 31 * result + (getRotaryPronunciation() != null ? getRotaryPronunciation().hashCode() : 0); + result = 31 * result + (getManeuver() != null ? getManeuver().hashCode() : 0); + result = 31 * result + Double.valueOf(getWeight()).hashCode(); + result = 31 * result + (getIntersections() != null ? getIntersections().hashCode() : 0); + return result; + } + + @Override + public String toString() { + return "LegStep{" + + "distance=" + distance + + ", duration=" + duration + + ", geometry='" + geometry + '\'' + + ", name='" + name + '\'' + + ", ref='" + ref + '\'' + + ", destinations='" + destinations + '\'' + + ", mode='" + mode + '\'' + + ", pronunciation='" + pronunciation + '\'' + + ", rotaryName='" + rotaryName + '\'' + + ", rotaryPronunciation='" + rotaryPronunciation + '\'' + + ", maneuver=" + maneuver + + ", weight=" + weight + + ", intersections=" + intersections + + '}'; + } } diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/RouteLeg.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/RouteLeg.java index a242ec136..00599f937 100644 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/RouteLeg.java +++ b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/RouteLeg.java @@ -123,4 +123,54 @@ public LegAnnotation getAnnotation() { public void setAnnotation(LegAnnotation annotation) { this.annotation = annotation; } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + RouteLeg routeLeg = (RouteLeg) o; + + if (Double.compare(routeLeg.getDistance(), getDistance()) != 0) { + return false; + } + if (Double.compare(routeLeg.getDuration(), getDuration()) != 0) { + return false; + } + if (getSummary() != null ? !getSummary().equals(routeLeg.getSummary()) : routeLeg.getSummary() != null) { + return false; + } + if (getSteps() != null ? !getSteps().equals(routeLeg.getSteps()) : routeLeg.getSteps() != null) { + return false; + } + return getAnnotation() != null + ? getAnnotation().equals(routeLeg.getAnnotation()) : routeLeg.getAnnotation() == null; + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Double.valueOf(getDistance()).hashCode(); + result = 31 * result + Double.valueOf(getDuration()).hashCode(); + result = 31 * result + (getSummary() != null ? getSummary().hashCode() : 0); + result = 31 * result + (getSteps() != null ? getSteps().hashCode() : 0); + result = 31 * result + (getAnnotation() != null ? getAnnotation().hashCode() : 0); + return result; + } + + @Override + public String toString() { + return "RouteLeg{" + + "distance=" + distance + + ", duration=" + duration + + ", summary='" + summary + '\'' + + ", steps=" + steps + + ", annotation=" + annotation + + '}'; + } } diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/StepIntersection.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/StepIntersection.java index fa4c2d078..1f80cfdf6 100644 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/StepIntersection.java +++ b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/StepIntersection.java @@ -2,6 +2,8 @@ import com.mapbox.services.commons.models.Position; +import java.util.Arrays; + /** * Object representing an intersection along the step. * @@ -187,4 +189,61 @@ public IntersectionLanes[] getLanes() { public void setLanes(IntersectionLanes[] lanes) { this.lanes = lanes; } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + StepIntersection stepIntersection = (StepIntersection) o; + + if (getLocation() != null ? !Arrays.equals(getLocation(), + stepIntersection.getLocation()) : stepIntersection.getLocation() != null) { + return false; + } + if (getBearings() != null ? !Arrays.equals(getBearings(), + stepIntersection.getBearings()) : stepIntersection.getBearings() != null) { + return false; + } + if (getEntry() != null ? !Arrays.equals(getEntry(), + stepIntersection.getEntry()) : stepIntersection.getEntry() != null) { + return false; + } + if (getIn() != stepIntersection.getIn()) { + return false; + } + if (getOut() != stepIntersection.getOut()) { + return false; + } + return !(getLanes() != null ? !Arrays.equals(getLanes(), + stepIntersection.getLanes()) : stepIntersection.getLanes() != null); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (getLocation() != null ? Arrays.hashCode(getLocation()) : 0); + result = 31 * result + (getBearings() != null ? Arrays.hashCode(getBearings()) : 0); + result = 31 * result + (getEntry() != null ? Arrays.hashCode(getEntry()) : 0); + result = 31 * result + getIn(); + result = 31 * result + getOut(); + result = 31 * result + (getLanes() != null ? Arrays.hashCode(getLanes()) : 0); + return result; + } + + @Override + public String toString() { + return "StepIntersection{" + + "location=" + Arrays.toString(location) + + ", bearings=" + Arrays.toString(bearings) + + ", entry=" + Arrays.toString(entry) + + ", in=" + in + + ", out=" + out + + ", lanes=" + Arrays.toString(lanes) + + '}'; + } } diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/StepManeuver.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/StepManeuver.java index 845c6a514..50a51e73b 100644 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/StepManeuver.java +++ b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directions/v5/models/StepManeuver.java @@ -230,21 +230,61 @@ public Position asPosition() { return Position.fromCoordinates(location[0], location[1]); } - /** - * Offers a convenient string with all the {@link StepManeuver} variables. - * - * @return String with all {@link StepManeuver} information within. - * @since 1.0.0 - */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + StepManeuver that = (StepManeuver) o; + + if (Double.compare(that.getBearingBefore(), getBearingBefore()) != 0) { + return false; + } + if (Double.compare(that.getBearingAfter(), getBearingAfter()) != 0) { + return false; + } + if (!Arrays.equals(getLocation(), that.getLocation())) { + return false; + } + if (getType() != null ? !getType().equals(that.getType()) : that.getType() != null) { + return false; + } + if (getModifier() != null ? !getModifier().equals(that.getModifier()) : that.getModifier() != null) { + return false; + } + if (getInstruction() != null ? !getInstruction().equals(that.getInstruction()) : that.getInstruction() != null) { + return false; + } + return getExit() != null ? getExit().equals(that.getExit()) : that.getExit() == null; + + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Arrays.hashCode(getLocation()); + result = 31 * result + Double.valueOf(getBearingBefore()).hashCode(); + result = 31 * result + Double.valueOf(getBearingAfter()).hashCode(); + result = 31 * result + (getType() != null ? getType().hashCode() : 0); + result = 31 * result + (getModifier() != null ? getModifier().hashCode() : 0); + result = 31 * result + (getInstruction() != null ? getInstruction().hashCode() : 0); + result = 31 * result + (getExit() != null ? getExit().hashCode() : 0); + return result; + } + @Override public String toString() { return "StepManeuver{" + "location=" + Arrays.toString(location) + ", bearingBefore=" + bearingBefore + ", bearingAfter=" + bearingAfter - + ", instruction='" + instruction + '\'' + ", type='" + type + '\'' + ", modifier='" + modifier + '\'' + + ", instruction='" + instruction + '\'' + ", exit=" + exit + '}'; } diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directionsmatrix/v1/models/DirectionsMatrixResponse.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directionsmatrix/v1/models/DirectionsMatrixResponse.java index 8d0eb853d..4d0e728c0 100644 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directionsmatrix/v1/models/DirectionsMatrixResponse.java +++ b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/directionsmatrix/v1/models/DirectionsMatrixResponse.java @@ -2,6 +2,7 @@ import com.mapbox.services.api.directions.v5.models.DirectionsWaypoint; +import java.util.Arrays; import java.util.List; /** @@ -18,6 +19,7 @@ public class DirectionsMatrixResponse { /** * Empty constructor + * * @since 2.1.0 */ public DirectionsMatrixResponse() { @@ -116,4 +118,49 @@ public List getSources() { public void setSources(List sources) { this.sources = sources; } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + DirectionsMatrixResponse that = (DirectionsMatrixResponse) o; + + if (getCode() != null ? !getCode().equals(that.getCode()) : that.getCode() != null) { + return false; + } + if (!Arrays.deepEquals(getDurations(), that.getDurations())) { + return false; + } + if (getDestinations() != null + ? !getDestinations().equals(that.getDestinations()) : that.getDestinations() != null) { + return false; + } + return getSources() != null ? getSources().equals(that.getSources()) : that.getSources() == null; + + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (getCode() != null ? getCode().hashCode() : 0); + result = 31 * result + Arrays.deepHashCode(getDurations()); + result = 31 * result + (getDestinations() != null ? getDestinations().hashCode() : 0); + result = 31 * result + (getSources() != null ? getSources().hashCode() : 0); + return result; + } + + @Override + public String toString() { + return "DirectionsMatrixResponse{" + + "code='" + code + '\'' + + ", durations=" + Arrays.toString(durations) + + ", destinations=" + destinations + + ", sources=" + sources + + '}'; + } } diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/geocoding/v5/models/CarmenContext.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/geocoding/v5/models/CarmenContext.java index 044865fdf..ed4c15e7f 100644 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/geocoding/v5/models/CarmenContext.java +++ b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/geocoding/v5/models/CarmenContext.java @@ -77,4 +77,56 @@ public String getCategory() { public String getMaki() { return maki; } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + CarmenContext that = (CarmenContext) o; + + if (getId() != null ? !getId().equals(that.getId()) : that.getId() != null) { + return false; + } + if (getText() != null ? !getText().equals(that.getText()) : that.getText() != null) { + return false; + } + if (getShortCode() != null ? !getShortCode().equals(that.getShortCode()) : that.getShortCode() != null) { + return false; + } + if (getWikidata() != null ? !getWikidata().equals(that.getWikidata()) : that.getWikidata() != null) { + return false; + } + if (getCategory() != null ? !getCategory().equals(that.getCategory()) : that.getCategory() != null) { + return false; + } + return getMaki() != null ? getMaki().equals(that.getMaki()) : that.getMaki() == null; + } + + @Override + public int hashCode() { + int result = getId() != null ? getId().hashCode() : 0; + result = 31 * result + (getText() != null ? getText().hashCode() : 0); + result = 31 * result + (getShortCode() != null ? getShortCode().hashCode() : 0); + result = 31 * result + (getWikidata() != null ? getWikidata().hashCode() : 0); + result = 31 * result + (getCategory() != null ? getCategory().hashCode() : 0); + result = 31 * result + (getMaki() != null ? getMaki().hashCode() : 0); + return result; + } + + @Override + public String toString() { + return "CarmenContext{" + + "id='" + id + '\'' + + ", text='" + text + '\'' + + ", shortCode='" + shortCode + '\'' + + ", wikidata='" + wikidata + '\'' + + ", category='" + category + '\'' + + ", maki='" + maki + '\'' + + '}'; + } } diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/geocoding/v5/models/CarmenFeature.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/geocoding/v5/models/CarmenFeature.java index f802a727b..3ea91d6b5 100644 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/geocoding/v5/models/CarmenFeature.java +++ b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/geocoding/v5/models/CarmenFeature.java @@ -10,6 +10,7 @@ import com.mapbox.services.commons.geojson.custom.PositionDeserializer; import com.mapbox.services.commons.models.Position; +import java.util.Arrays; import java.util.List; /** @@ -30,7 +31,6 @@ public class CarmenFeature extends Feature { private String address; private double[] center; private List context; - private double relevance; /** @@ -158,15 +158,62 @@ public Position asPosition() { return Position.fromCoordinates(center[0], center[1]); } - /** - * Human-readable text representing the full result hierarchy - * (e.g. "Austin, Texas, United States"). - * - * @return String with human-readable text. - * @since 1.0.0 - */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + CarmenFeature that = (CarmenFeature) o; + + if (Double.compare(that.getRelevance(), getRelevance()) != 0) { + return false; + } + if (getText() != null ? !getText().equals(that.getText()) : that.getText() != null) { + return false; + } + if (getPlaceName() != null ? !getPlaceName().equals(that.getPlaceName()) : that.getPlaceName() != null) { + return false; + } + if (!Arrays.equals(getBbox(), that.getBbox())) { + return false; + } + if (getAddress() != null ? !getAddress().equals(that.getAddress()) : that.getAddress() != null) { + return false; + } + if (!Arrays.equals(getCenter(), that.getCenter())) { + return false; + } + return getContext() != null ? getContext().equals(that.getContext()) : that.getContext() == null; + + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (getText() != null ? getText().hashCode() : 0); + result = 31 * result + (getPlaceName() != null ? getPlaceName().hashCode() : 0); + result = 31 * result + Arrays.hashCode(getBbox()); + result = 31 * result + (getAddress() != null ? getAddress().hashCode() : 0); + result = 31 * result + Arrays.hashCode(getCenter()); + result = 31 * result + (getContext() != null ? getContext().hashCode() : 0); + result = 31 * result + Double.valueOf(getRelevance()).hashCode(); + return result; + } + @Override public String toString() { - return getPlaceName(); + return "CarmenFeature{" + + "text='" + text + '\'' + + ", placeName='" + placeName + '\'' + + ", bbox=" + Arrays.toString(bbox) + + ", address='" + address + '\'' + + ", center=" + Arrays.toString(center) + + ", context=" + context + + ", relevance=" + relevance + + '}'; } } diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/geocoding/v5/models/CarmenFeatureCollection.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/geocoding/v5/models/CarmenFeatureCollection.java index 067d26fa3..70f11c268 100644 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/geocoding/v5/models/CarmenFeatureCollection.java +++ b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/geocoding/v5/models/CarmenFeatureCollection.java @@ -93,4 +93,42 @@ public static CarmenFeatureCollection fromFeatures(List features) return new CarmenFeatureCollection(features); } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + CarmenFeatureCollection that = (CarmenFeatureCollection) o; + + if (getQuery() != null ? !getQuery().equals(that.getQuery()) : that.getQuery() != null) { + return false; + } + if (getAttribution() != null ? !getAttribution().equals(that.getAttribution()) : that.getAttribution() != null) { + return false; + } + return getFeatures() != null ? getFeatures().equals(that.getFeatures()) : that.getFeatures() == null; + + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (getQuery() != null ? getQuery().hashCode() : 0); + result = 31 * result + (getAttribution() != null ? getAttribution().hashCode() : 0); + result = 31 * result + (getFeatures() != null ? getFeatures().hashCode() : 0); + return result; + } + + @Override + public String toString() { + return "CarmenFeatureCollection{" + + "query=" + query + + ", attribution='" + attribution + '\'' + + ", features=" + features + + '}'; + } } diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/mapmatching/v5/models/MapMatchingMatching.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/mapmatching/v5/models/MapMatchingMatching.java index 98ad92c4c..75b630366 100644 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/mapmatching/v5/models/MapMatchingMatching.java +++ b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/mapmatching/v5/models/MapMatchingMatching.java @@ -29,4 +29,36 @@ public double getConfidence() { public void setConfidence(double confidence) { this.confidence = confidence; } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } + + MapMatchingMatching that = (MapMatchingMatching) o; + + return Double.compare(that.getConfidence(), getConfidence()) == 0; + + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Double.valueOf(getConfidence()).hashCode(); + return result; + } + + @Override + public String toString() { + return "MapMatchingMatching{" + + "confidence=" + confidence + + '}'; + } } diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/mapmatching/v5/models/MapMatchingResponse.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/mapmatching/v5/models/MapMatchingResponse.java index c5afe4a8c..3f95dbea7 100644 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/mapmatching/v5/models/MapMatchingResponse.java +++ b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/mapmatching/v5/models/MapMatchingResponse.java @@ -81,4 +81,43 @@ public List getTracepoints() { public void setTracepoints(List tracepoints) { this.tracepoints = tracepoints; } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + MapMatchingResponse that = (MapMatchingResponse) o; + + if (getCode() != null ? !getCode().equals(that.getCode()) : that.getCode() != null) { + return false; + } + if (getMatchings() != null ? !getMatchings().equals(that.getMatchings()) : that.getMatchings() != null) { + return false; + } + return getTracepoints() != null ? getTracepoints().equals(that.getTracepoints()) : that.getTracepoints() == null; + + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (getCode() != null ? getCode().hashCode() : 0); + result = 31 * result + (getMatchings() != null ? getMatchings().hashCode() : 0); + result = 31 * result + (getTracepoints() != null ? getTracepoints().hashCode() : 0); + return result; + } + + @Override + public String toString() { + return "MapMatchingResponse{" + + "code='" + code + '\'' + + ", matchings=" + matchings + + ", tracepoints=" + tracepoints + + '}'; + } } diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/mapmatching/v5/models/MapMatchingTracepoint.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/mapmatching/v5/models/MapMatchingTracepoint.java index e42088c5c..5ffbedc7e 100644 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/mapmatching/v5/models/MapMatchingTracepoint.java +++ b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/mapmatching/v5/models/MapMatchingTracepoint.java @@ -66,6 +66,7 @@ public void setWaypointIndex(int waypointIndex) { this.waypointIndex = waypointIndex; } + /** * Number of probable alternative matchings for this trace point. A value of zero indicates that this point was * matched unambiguously. Split the trace at these points for incremental map matching. @@ -87,4 +88,45 @@ public int getAlternativesCount() { public void setAlternativesCount(int alternativesCount) { this.alternativesCount = alternativesCount; } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } + + MapMatchingTracepoint that = (MapMatchingTracepoint) o; + + if (getMatchingsIndex() != that.getMatchingsIndex()) { + return false; + } + if (getAlternativesCount() != that.getAlternativesCount()) { + return false; + } + return getWaypointIndex() == that.getWaypointIndex(); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + getMatchingsIndex(); + result = 31 * result + getWaypointIndex(); + result = 31 * result + getAlternativesCount(); + return result; + } + + @Override + public String toString() { + return "MapMatchingTracepoint{" + + "matchingsIndex=" + matchingsIndex + + ", waypointIndex=" + waypointIndex + + ", alternativesCount=" + alternativesCount + + '}'; + } } diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/optimizedtrips/v1/models/OptimizationWaypoint.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/optimizedtrips/v1/models/OptimizationWaypoint.java index 4666fdc6d..fc00795a6 100644 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/optimizedtrips/v1/models/OptimizationWaypoint.java +++ b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/optimizedtrips/v1/models/OptimizationWaypoint.java @@ -69,4 +69,41 @@ public int getTripsIndex() { public void setTripsIndex(int tripsIndex) { this.tripsIndex = tripsIndex; } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } + + OptimizationWaypoint that = (OptimizationWaypoint) o; + + if (waypointIndex != that.waypointIndex) { + return false; + } + return tripsIndex == that.tripsIndex; + + } + + @Override + public int hashCode() { + int result = super.hashCode(); + result = 31 * result + waypointIndex; + result = 31 * result + tripsIndex; + return result; + } + + @Override + public String toString() { + return "OptimizationWaypoint{" + + "waypointIndex=" + waypointIndex + + ", tripsIndex=" + tripsIndex + + '}'; + } } diff --git a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/optimizedtrips/v1/models/OptimizedTripsResponse.java b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/optimizedtrips/v1/models/OptimizedTripsResponse.java index d520ed0ee..1001af387 100644 --- a/mapbox/libjava-services/src/main/java/com/mapbox/services/api/optimizedtrips/v1/models/OptimizedTripsResponse.java +++ b/mapbox/libjava-services/src/main/java/com/mapbox/services/api/optimizedtrips/v1/models/OptimizedTripsResponse.java @@ -111,4 +111,43 @@ public List getTrips() { public void setTrips(List trips) { this.trips = trips; } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + OptimizedTripsResponse that = (OptimizedTripsResponse) o; + + if (getCode() != null ? !getCode().equals(that.getCode()) : that.getCode() != null) { + return false; + } + if (getWaypoints() != null ? !getWaypoints().equals(that.getWaypoints()) : that.getWaypoints() != null) { + return false; + } + return getTrips() != null ? getTrips().equals(that.getTrips()) : that.getTrips() == null; + + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (getCode() != null ? getCode().hashCode() : 0); + result = 31 * result + (getWaypoints() != null ? getWaypoints().hashCode() : 0); + result = 31 * result + (getTrips() != null ? getTrips().hashCode() : 0); + return result; + } + + @Override + public String toString() { + return "OptimizedTripsResponse{" + + "code='" + code + '\'' + + ", waypoints=" + waypoints + + ", trips=" + trips + + '}'; + } }