Skip to content

Commit 650b87c

Browse files
author
Łukasz Paczos
committed
fix valid indication to provide a single possibility
1 parent 50997b7 commit 650b87c

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

services-directions-models/src/main/java/com/mapbox/api/directions/v5/models/IntersectionLanes.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ public static Builder builder() {
6363
* When both active and valid are false, this property will not be included in the response.
6464
* Only available on the mapbox/driving profile.
6565
*
66-
* @return Array of which of the lane indications is applicable to the current route,
66+
* @return which of the lane indications is applicable to the current route,
6767
* when there is more than one
6868
*/
6969
@Nullable
7070
@SerializedName("valid_indication")
71-
public abstract List<String> validIndications();
71+
public abstract String validIndication();
7272

7373
/**
7474
* Array that can be made up of multiple signs such as {@code left}, {@code right}, etc.
@@ -150,11 +150,11 @@ public abstract static class Builder {
150150
* Shows which of the lane indications is applicable to the current route,
151151
* when there is more than one.
152152
*
153-
* @param validIndications list of lane indications that are applicable to the current route,
153+
* @param validIndication lane indications applicable to the current route,
154154
* when there is more than one.
155155
* @return this builder for chaining options together
156156
*/
157-
public abstract Builder validIndications(@Nullable List<String> validIndications);
157+
public abstract Builder validIndication(@Nullable String validIndication);
158158

159159
/**
160160
* list that can be made up of multiple signs such as {@code left}, {@code right}, etc.

services-directions-models/src/test/java/com/mapbox/api/directions/v5/models/IntersectionLanesTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void testSerializableRoundTripping() throws Exception {
2626
IntersectionLanes intersectionLanes = IntersectionLanes.builder()
2727
.valid(true)
2828
.active(true)
29-
.validIndications(Collections.singletonList("straight"))
29+
.validIndication("straight")
3030
.indications(Arrays.asList("straight","slight left"))
3131
.build();
3232
byte[] serialized = TestUtils.serialize(intersectionLanes);
@@ -38,7 +38,7 @@ public void testJsonRoundTripping() {
3838
IntersectionLanes intersectionLanes = IntersectionLanes.builder()
3939
.valid(true)
4040
.active(true)
41-
.validIndications(Collections.singletonList("straight"))
41+
.validIndication("straight")
4242
.indications(Arrays.asList("straight","slight left"))
4343
.build();
4444

@@ -61,12 +61,12 @@ public void testFromJson_active() {
6161
}
6262

6363
@Test
64-
public void testFromJson_validIndications() {
64+
public void testFromJson_validIndication() {
6565
IntersectionLanes intersectionLanes = IntersectionLanes.builder()
66-
.validIndications(Collections.singletonList("straight"))
66+
.validIndication("straight")
6767
.build();
6868

69-
String jsonString = "{\"valid_indication\":[\"straight\"]}";
69+
String jsonString = "{\"valid_indication\":\"straight\"}";
7070
IntersectionLanes intersectionLanesFromJson = IntersectionLanes.fromJson(jsonString);
7171

7272
assertEquals(intersectionLanes, intersectionLanesFromJson);

0 commit comments

Comments
 (0)