File tree Expand file tree Collapse file tree 5 files changed +36
-28
lines changed
src/main/java/com/osrm/client Expand file tree Collapse file tree 5 files changed +36
-28
lines changed Original file line number Diff line number Diff line change 1- package com .osrm .client ;public class CostMatrices {
1+ package com .osrm .client ;
2+
3+ import lombok .Getter ;
4+ import lombok .RequiredArgsConstructor ;
5+
6+ @ Getter
7+ @ RequiredArgsConstructor
8+ public class CostMatrices {
9+ private final CostMatrix timeMatrix ;
10+ private final CostMatrix distanceMatrix ;
211}
Original file line number Diff line number Diff line change 44import java .util .List ;
55
66public class CostMatrix {
7- private int [][] matrix ;
7+ private final int [][] matrix ;
88
99 public CostMatrix (int size ) {
1010 this .matrix = new int [size ][size ];
Original file line number Diff line number Diff line change 22
33import com .google .gson .Gson ;
44import com .google .gson .annotations .SerializedName ;
5+ import lombok .Getter ;
6+ import lombok .RequiredArgsConstructor ;
57
68import java .util .List ;
79
8-
9- public class OSRMCostMatrixResponse implements CostMatrixResponse {
10-
10+ @ Getter
11+ @ RequiredArgsConstructor
12+ class OSRMCostMatrixResponse implements CostMatrixResponse {
1113 @ SerializedName ("matrix" )
1214 private final List <List <Integer >> costTable ;
1315
14- public OSRMCostMatrixResponse (List <List <Integer >> costTable ) {
15- this .costTable = costTable ;
16- }
17-
18- private List <List <Integer >> getCostTable () {
19- return costTable ;
20- }
21-
2216 public CostMatrix toCostMatrix () {
2317 CostMatrix matrix = new CostMatrix (getCostTable ().size ());
2418 int i = 0 ;
@@ -33,7 +27,6 @@ public CostMatrix toCostMatrix() {
3327 return matrix ;
3428 }
3529
36-
3730 public static OSRMCostMatrixResponse fromJSON (String json ) {
3831 return new Gson ().fromJson (json , OSRMCostMatrixResponse .class );
3932 }
Original file line number Diff line number Diff line change 1+ package com .osrm .client .request ;
2+
3+ import lombok .Builder ;
4+
5+ import java .util .List ;
6+
7+ @ Builder
8+ public class CostMatricesRequest {
9+ private final List <GeoLocation > locations ;
10+ private final double speedRate ;
11+ private final String country ;
12+ private final String token ;
13+ private final String profile ;
14+ private final String options ;
15+ }
Original file line number Diff line number Diff line change 1- package com .osrm .client ;
1+ package com .osrm .client . request ;
22
33import com .google .common .base .Objects ;
4+ import lombok .Getter ;
5+ import lombok .RequiredArgsConstructor ;
46
7+ @ Getter
8+ @ RequiredArgsConstructor
59public class GeoLocation {
610 private final Double latitude ;
711 private final Double longitude ;
812
9- public GeoLocation (Double latitude , Double longitude ) {
10- this .latitude = latitude ;
11- this .longitude = longitude ;
12- }
13-
14- public Double getLatitude () {
15- return this .latitude ;
16- }
17-
18- public Double getLongitude () {
19- return this .longitude ;
20- }
21-
2213 public String getLatLongString () {
2314 return this .getLatitude () + "," + this .getLongitude ();
2415 }
You can’t perform that action at this time.
0 commit comments