-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from traveltime-dev/time-map/fast
Time map/fast
- Loading branch information
Showing
46 changed files
with
647 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
...time/sdk/dto/responses/timemap/Shape.java → .../com/traveltime/sdk/dto/common/Shape.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/main/java/com/traveltime/sdk/dto/common/transportationfast/Cycling.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.traveltime.sdk.dto.common.transportationfast; | ||
|
||
import lombok.Value; | ||
|
||
@Value | ||
public class Cycling implements Transportation { } |
6 changes: 6 additions & 0 deletions
6
src/main/java/com/traveltime/sdk/dto/common/transportationfast/CyclingAndFerry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.traveltime.sdk.dto.common.transportationfast; | ||
|
||
import lombok.Value; | ||
|
||
@Value | ||
public class CyclingAndFerry implements Transportation { } |
6 changes: 6 additions & 0 deletions
6
src/main/java/com/traveltime/sdk/dto/common/transportationfast/Driving.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.traveltime.sdk.dto.common.transportationfast; | ||
|
||
import lombok.Value; | ||
|
||
@Value | ||
public class Driving implements Transportation { } |
6 changes: 6 additions & 0 deletions
6
src/main/java/com/traveltime/sdk/dto/common/transportationfast/DrivingAndFerry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.traveltime.sdk.dto.common.transportationfast; | ||
|
||
import lombok.Value; | ||
|
||
@Value | ||
public class DrivingAndFerry implements Transportation { } |
3 changes: 1 addition & 2 deletions
3
...sportation/DrivingAndPublicTransport.java → ...tationfast/DrivingAndPublicTransport.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/main/java/com/traveltime/sdk/dto/common/transportationfast/PublicTransport.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.traveltime.sdk.dto.common.transportationfast; | ||
|
||
import lombok.Value; | ||
|
||
@Value | ||
public class PublicTransport implements Transportation { } |
3 changes: 1 addition & 2 deletions
3
...quests/timefilterfast/Transportation.java → ...on/transportationfast/Transportation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/main/java/com/traveltime/sdk/dto/common/transportationfast/Walking.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.traveltime.sdk.dto.common.transportationfast; | ||
|
||
import lombok.Value; | ||
|
||
@Value | ||
public class Walking implements Transportation { } |
6 changes: 6 additions & 0 deletions
6
src/main/java/com/traveltime/sdk/dto/common/transportationfast/WalkingAndFerry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.traveltime.sdk.dto.common.transportationfast; | ||
|
||
import lombok.Value; | ||
|
||
@Value | ||
public class WalkingAndFerry implements Transportation { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/main/java/com/traveltime/sdk/dto/requests/TimeMapFastBoxesRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.traveltime.sdk.dto.requests; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.traveltime.sdk.auth.TravelTimeCredentials; | ||
import com.traveltime.sdk.dto.requests.timemapfast.ArrivalSearches; | ||
import com.traveltime.sdk.dto.responses.TimeMapFastBoxesResponse; | ||
import com.traveltime.sdk.dto.responses.errors.TravelTimeError; | ||
import com.traveltime.sdk.utils.AcceptType; | ||
import com.traveltime.sdk.utils.JsonUtils; | ||
import io.vavr.control.Either; | ||
import lombok.*; | ||
import lombok.extern.jackson.Jacksonized; | ||
import okhttp3.HttpUrl; | ||
import okhttp3.Request; | ||
|
||
@Value | ||
@Builder | ||
@Jacksonized | ||
@AllArgsConstructor | ||
@EqualsAndHashCode(callSuper = true) | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class TimeMapFastBoxesRequest extends TravelTimeRequest<TimeMapFastBoxesResponse> { | ||
@NonNull | ||
ArrivalSearches arrivalSearches; | ||
|
||
@Override | ||
public Either<TravelTimeError, Request> createRequest(HttpUrl baseUri, TravelTimeCredentials credentials) { | ||
val uri = baseUri.newBuilder().addPathSegments("time-map/fast").build(); | ||
AcceptType acceptType = AcceptType.APPLICATION_BOUNDING_BOXES_JSON; | ||
return JsonUtils | ||
.toJson(this) | ||
.map(json -> createPostRequest(credentials, uri, json, acceptType)); | ||
} | ||
|
||
@Override | ||
public Class<TimeMapFastBoxesResponse> responseType() { | ||
return TimeMapFastBoxesResponse.class; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/com/traveltime/sdk/dto/requests/TimeMapFastGeoJsonRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.traveltime.sdk.dto.requests; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.traveltime.sdk.auth.TravelTimeCredentials; | ||
import com.traveltime.sdk.dto.requests.timemapfast.ArrivalSearches; | ||
import com.traveltime.sdk.dto.responses.TimeMapFastGeoJsonResponse; | ||
import com.traveltime.sdk.dto.responses.errors.TravelTimeError; | ||
import com.traveltime.sdk.utils.AcceptType; | ||
import com.traveltime.sdk.utils.JsonUtils; | ||
import io.vavr.control.Either; | ||
import lombok.*; | ||
import lombok.extern.jackson.Jacksonized; | ||
import okhttp3.HttpUrl; | ||
import okhttp3.Request; | ||
|
||
@Value | ||
@Builder | ||
@Jacksonized | ||
@AllArgsConstructor | ||
@EqualsAndHashCode(callSuper = true) | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class TimeMapFastGeoJsonRequest extends TravelTimeRequest<TimeMapFastGeoJsonResponse> { | ||
@NonNull | ||
ArrivalSearches arrivalSearches; | ||
|
||
@Override | ||
public Either<TravelTimeError, Request> createRequest(HttpUrl baseUri, TravelTimeCredentials credentials) { | ||
val uri = baseUri.newBuilder().addPathSegments("time-map/fast").build(); | ||
return JsonUtils | ||
.toJson(this) | ||
.map(json -> createPostRequest(credentials, uri, json, AcceptType.APPLICATION_GEO_JSON)); | ||
} | ||
|
||
@Override | ||
public Class<TimeMapFastGeoJsonResponse> responseType() { | ||
return TimeMapFastGeoJsonResponse.class; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/com/traveltime/sdk/dto/requests/TimeMapFastRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.traveltime.sdk.dto.requests; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.traveltime.sdk.auth.TravelTimeCredentials; | ||
import com.traveltime.sdk.dto.requests.timemapfast.ArrivalSearches; | ||
import com.traveltime.sdk.dto.responses.TimeMapFastResponse; | ||
import com.traveltime.sdk.dto.responses.errors.TravelTimeError; | ||
import com.traveltime.sdk.utils.AcceptType; | ||
import com.traveltime.sdk.utils.JsonUtils; | ||
import io.vavr.control.Either; | ||
import lombok.*; | ||
import lombok.extern.jackson.Jacksonized; | ||
import okhttp3.HttpUrl; | ||
import okhttp3.Request; | ||
|
||
@Value | ||
@Builder | ||
@Jacksonized | ||
@AllArgsConstructor | ||
@EqualsAndHashCode(callSuper = true) | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class TimeMapFastRequest extends TravelTimeRequest<TimeMapFastResponse> { | ||
@NonNull | ||
ArrivalSearches arrivalSearches; | ||
|
||
@Override | ||
public Either<TravelTimeError, Request> createRequest(HttpUrl baseUri, TravelTimeCredentials credentials) { | ||
val uri = baseUri.newBuilder().addPathSegments("time-map/fast").build(); | ||
return JsonUtils | ||
.toJson(this) | ||
.map(json -> createPostRequest(credentials, uri, json, AcceptType.APPLICATION_JSON)); | ||
} | ||
|
||
@Override | ||
public Class<TimeMapFastResponse> responseType() { | ||
return TimeMapFastResponse.class; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
src/main/java/com/traveltime/sdk/dto/requests/TimeMapFastWktRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.traveltime.sdk.dto.requests; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.traveltime.sdk.auth.TravelTimeCredentials; | ||
import com.traveltime.sdk.dto.requests.timemapfast.ArrivalSearches; | ||
import com.traveltime.sdk.dto.responses.TimeMapFastWktResponse; | ||
import com.traveltime.sdk.dto.responses.errors.TravelTimeError; | ||
import com.traveltime.sdk.utils.AcceptType; | ||
import com.traveltime.sdk.utils.JsonUtils; | ||
import io.vavr.control.Either; | ||
import lombok.*; | ||
import lombok.extern.jackson.Jacksonized; | ||
import okhttp3.HttpUrl; | ||
import okhttp3.Request; | ||
|
||
@Value | ||
@Builder | ||
@Jacksonized | ||
@AllArgsConstructor | ||
@EqualsAndHashCode(callSuper = true) | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class TimeMapFastWktRequest extends TravelTimeRequest<TimeMapFastWktResponse> { | ||
@NonNull | ||
ArrivalSearches arrivalSearches; | ||
@Builder.Default | ||
boolean withHoles = true; | ||
|
||
private AcceptType acceptType() { | ||
return withHoles ? AcceptType.APPLICATION_WKT_JSON : AcceptType.APPLICATION_WKT_NO_HOLES_JSON; | ||
} | ||
|
||
@Override | ||
public Either<TravelTimeError, Request> createRequest(HttpUrl baseUri, TravelTimeCredentials credentials) { | ||
val uri = baseUri.newBuilder().addPathSegments("time-map/fast").build(); | ||
return JsonUtils | ||
.toJson(this) | ||
.map(json -> createPostRequest(credentials, uri, json, acceptType())); | ||
} | ||
|
||
@Override | ||
public Class<TimeMapFastWktResponse> responseType() { | ||
return TimeMapFastWktResponse.class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/main/java/com/traveltime/sdk/dto/requests/timefilterfast/ManyToOne.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/main/java/com/traveltime/sdk/dto/requests/timefilterfast/OneToMany.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
src/main/java/com/traveltime/sdk/dto/requests/timefilterfast/transportation/Cycling.java
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
...n/java/com/traveltime/sdk/dto/requests/timefilterfast/transportation/CyclingAndFerry.java
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
src/main/java/com/traveltime/sdk/dto/requests/timefilterfast/transportation/Driving.java
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
...n/java/com/traveltime/sdk/dto/requests/timefilterfast/transportation/DrivingAndFerry.java
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
...n/java/com/traveltime/sdk/dto/requests/timefilterfast/transportation/PublicTransport.java
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
src/main/java/com/traveltime/sdk/dto/requests/timefilterfast/transportation/Walking.java
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
...n/java/com/traveltime/sdk/dto/requests/timefilterfast/transportation/WalkingAndFerry.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.