Skip to content

Commit faa2cc7

Browse files
committed
wip
1 parent 579b48f commit faa2cc7

File tree

2 files changed

+29
-17
lines changed
  • libnavigation-base/src/main/java/com/mapbox/navigation/base/internal/route
  • libtesting-navigation-base/src/main/java/com/mapbox/navigation/testing/factories

2 files changed

+29
-17
lines changed

libnavigation-base/src/main/java/com/mapbox/navigation/base/internal/route/Waypoint.kt

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package com.mapbox.navigation.base.internal.route
33
import androidx.annotation.IntDef
44
import com.mapbox.geojson.Point
55

6-
data class Waypoint(
6+
class Waypoint internal constructor(
77
val location: Point,
88
@Type val type: Int,
99
val name: String,
@@ -24,4 +24,32 @@ data class Waypoint(
2424
@Retention(AnnotationRetention.BINARY)
2525
@IntDef(REGULAR, SILENT, EV_CHARGING)
2626
annotation class Type
27+
28+
override fun equals(other: Any?): Boolean {
29+
if (this === other) return true
30+
if (javaClass != other?.javaClass) return false
31+
32+
other as Waypoint
33+
34+
if (location != other.location) return false
35+
if (type != other.type) return false
36+
if (name != other.name) return false
37+
if (target != other.target) return false
38+
39+
return true
40+
}
41+
42+
override fun hashCode(): Int {
43+
var result = location.hashCode()
44+
result = 31 * result + type
45+
result = 31 * result + name.hashCode()
46+
result = 31 * result + target.hashCode()
47+
return result
48+
}
49+
50+
override fun toString(): String {
51+
return "Waypoint(location=$location, type=$type, name='$name', target=$target)"
52+
}
53+
54+
2755
}

libtesting-navigation-base/src/main/java/com/mapbox/navigation/testing/factories/NavigationRouteFactory.kt

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,6 @@ fun createNavigationRoute(
4141
)
4242
)
4343
}
44-
45-
override fun parseDirectionsRoutes(
46-
directionsRoutes: String,
47-
request: String,
48-
routerOrigin: RouterOrigin
49-
): Expected<String, List<RouteInterface>> {
50-
throw IllegalStateException("parseDirectionsRoutes is not supported yet")
51-
}
5244
}
5345
)
5446
}
@@ -80,14 +72,6 @@ class TestSDKRouteParser : SDKRouteParser {
8072
)
8173
return ExpectedFactory.createValue(result)
8274
}
83-
84-
override fun parseDirectionsRoutes(
85-
directionsRoutes: String,
86-
request: String,
87-
routerOrigin: RouterOrigin
88-
): Expected<String, List<RouteInterface>> {
89-
throw IllegalStateException("parseDirectionsRoutes is not supported yet")
90-
}
9175
}
9276

9377
fun createRouteInterfacesFromDirectionRequestResponse(

0 commit comments

Comments
 (0)