Skip to content

Commit ff132a5

Browse files
PaymentMethods.etc2 (#1589)
1 parent 987b2c9 commit ff132a5

File tree

4 files changed

+51
-0
lines changed

4 files changed

+51
-0
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ Mapbox welcomes participation and contributions from everyone.
44

55
### main
66

7+
### v7.2.0 - August 28, 2024
8+
9+
- Added `PaymentMethods#etc2` payment method.
10+
- Added `V6StructuredInputQuery#country` option.
11+
12+
13+
### v7.1.0 - July 8, 2024
14+
15+
- Optimize memory usage in Directions API model classes by interning frequently occurring strings in JSON
16+
17+
718
### v7.0.0 - April 23, 2024
819

920
- Added Geocoding V6 Support.

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ public static Builder builder() {
3232
@Nullable
3333
public abstract CostPerVehicleSize etc();
3434

35+
/*
36+
* Information about payment by etc2.
37+
*
38+
* return etc2 payment method
39+
*/
40+
@Nullable
41+
public abstract CostPerVehicleSize etc2();
42+
3543
/*
3644
* Information about payment by cash.
3745
*
@@ -89,6 +97,15 @@ public abstract static class Builder
8997
@NonNull
9098
public abstract Builder etc(@Nullable CostPerVehicleSize etc);
9199

100+
/*
101+
* Information about payment by etc2.
102+
*
103+
* param etc2 payment method
104+
* return this builder for chaining options together
105+
*/
106+
@NonNull
107+
public abstract Builder etc2(@Nullable CostPerVehicleSize etc2);
108+
92109
/*
93110
* Information about payment by cash.
94111
*

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,25 @@ public void directionsRoute_hasTollCosts() throws IOException {
134134
DirectionsRoute route = DirectionsRoute.fromJson(json, options, uuid);
135135

136136
assertEquals(2, route.tollCosts().size());
137+
138+
PaymentMethods paymentMethods = route.tollCosts().get(0).paymentMethods();
139+
140+
CostPerVehicleSize etc = CostPerVehicleSize.builder()
141+
.middle(5566.0)
142+
.build();
143+
assertEquals(etc, paymentMethods.etc());
144+
145+
CostPerVehicleSize etc2 = CostPerVehicleSize.builder()
146+
.middle(6789.0)
147+
.standard(7890.0)
148+
.build();
149+
assertEquals(etc2, paymentMethods.etc2());
150+
151+
CostPerVehicleSize cash = CostPerVehicleSize.builder()
152+
.small(123.0)
153+
.large(4567.0)
154+
.build();
155+
assertEquals(cash, paymentMethods.cash());
137156
}
138157

139158
@Test

services-directions-models/src/test/resources/directions_v5_with_toll_costs.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
"etc": {
1313
"middle": 5566
1414
},
15+
"etc2": {
16+
"middle": 6789,
17+
"standard": 7890
18+
},
1519
"cash": {
1620
"small": 123,
1721
"large": 4567

0 commit comments

Comments
 (0)