Skip to content

Commit

Permalink
#23 Use fluent if-else
Browse files Browse the repository at this point in the history
Co-authored-by: Leonard Ehrenfried <[email protected]>
  • Loading branch information
jspetrak and leonardehrenfried authored Mar 12, 2024
1 parent 2da2564 commit 40e463d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/main/java/org/opentripplanner/client/OtpApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ public TripPlan plan(TripPlanParameters req) throws IOException {
req.time().toLocalDate().toString(),
req.time().toLocalTime().truncatedTo(ChronoUnit.SECONDS).toString(),
req.searchDirection().isArriveBy(),
req.searchWindow().isPresent()
? String.format("searchWindow : %d", req.searchWindow().get().toMinutes())
: "",
req.searchWindow().map(sw -> "searchWindow : %d".formatted(sw.toMinutes())).orElseGet(""),
req.walkReluctance(),
req.wheelchair());

Expand Down

0 comments on commit 40e463d

Please sign in to comment.