-
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 branch 'main' into test/NAV-77-Integration-Test-for-Rest-Contro…
…ller
- Loading branch information
Showing
13 changed files
with
916 additions
and
255 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package ch.naviqore.raptor; | ||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
/** | ||
* Configuration to query connections or iso-lines. Default values are set to infinity or zero, which means that no | ||
* restrictions are set. | ||
*/ | ||
@NoArgsConstructor | ||
@Getter | ||
public class QueryConfig { | ||
|
||
private static final int INFINITY = Integer.MAX_VALUE; | ||
|
||
private int maximumWalkingDuration = INFINITY; | ||
private int minimumTransferDuration = 0; | ||
private int maximumTransferNumber = INFINITY; | ||
private int maximumTravelTime = INFINITY; | ||
|
||
public QueryConfig(int maximumWalkingDuration, int minimumTransferDuration, int maximumTransferNumber, | ||
int maximumTravelTime) { | ||
this.setMaximumWalkingDuration(maximumWalkingDuration); | ||
this.setMinimumTransferDuration(minimumTransferDuration); | ||
this.setMaximumTransferNumber(maximumTransferNumber); | ||
this.setMaximumTravelTime(maximumTravelTime); | ||
} | ||
|
||
public void setMaximumWalkingDuration(int maximumWalkingDuration) { | ||
if (maximumWalkingDuration < 0) { | ||
throw new IllegalArgumentException("Maximum walking duration must be greater than or equal to 0."); | ||
} | ||
this.maximumWalkingDuration = maximumWalkingDuration; | ||
} | ||
|
||
public void setMinimumTransferDuration(int minimumTransferDuration) { | ||
if (minimumTransferDuration < 0) { | ||
throw new IllegalArgumentException("Minimum transfer duration must be greater than or equal to 0."); | ||
} | ||
this.minimumTransferDuration = minimumTransferDuration; | ||
} | ||
|
||
public void setMaximumTransferNumber(int maximumTransferNumber) { | ||
if (maximumTransferNumber < 0) { | ||
throw new IllegalArgumentException("Maximum transfer number must be greater than or equal to 0."); | ||
} | ||
this.maximumTransferNumber = maximumTransferNumber; | ||
} | ||
|
||
public void setMaximumTravelTime(int maximumTravelTime) { | ||
if (maximumTravelTime <= 0) { | ||
throw new IllegalArgumentException("Maximum transfer number must be greater than 0."); | ||
} | ||
this.maximumTravelTime = maximumTravelTime; | ||
} | ||
|
||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
package ch.naviqore.raptor; | ||
|
||
record Stop(String id, int stopRouteIdx, int numberOfRoutes, int transferIdx, int numberOfTransfers) { | ||
record Stop(String id, int stopRouteIdx, int numberOfRoutes, int sameStationTransferTime, int transferIdx, | ||
int numberOfTransfers) { | ||
} |
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
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
Oops, something went wrong.