public class RequestModeOfTransport<T extends RequestModeOfTransport<T>> extends Object implements Validatable
ModeOfTransport and attributes exclusive to this mode
of transport.
In its minimal form it only consists of a ModeOfTransport.
For simple cases use the static standard modes such as
ModeOfTransport.STANDARD_BICYCLE to build a
RequestModeOfTransport.
For complex cases, such as public transport or sharing providers the routing service would ideally provide an interface to retrieve the supported modes.
| Constructor and Description |
|---|
RequestModeOfTransport() |
| Modifier and Type | Method and Description |
|---|---|
static RequestModeOfTransport<?> |
createMinimal(ModeOfTransport modeOfTransport) |
boolean |
equals(Object obj) |
Map<String,Object> |
getAdditionalInfo()
Other attributes exclusive to this
ModeOfTransport. |
Optional<GeoJSONFeature<GeoJSONMultiPolygon>> |
getForbiddenAreas()
A multipolygon defining areas the route must not cross
|
List<Location<?>> |
getLocations()
Locations where this mode of transport is available.
|
Optional<Integer> |
getMaximumDistanceMeters()
maximum distance to be covered with this mode of transport in one
RouteSegment |
Optional<Integer> |
getMaximumTravelTimeSeconds()
maximum travel time with this mode of transport in one
RouteSegment |
ModeOfTransport |
getModeOfTransport() |
Optional<String> |
getSpeed()
speed for this mode of transport - either one of
Constants.Speed
or a number in kph |
Optional<Integer> |
getUserAffinity()
A user's affinity of the mode of transport, preferably in the range of 0
(does not like it at all) to 100 (loves it).
|
int |
hashCode() |
T |
setAdditionalInfo(Map<String,Object> additionalInfo) |
T |
setForbiddenAreas(GeoJSONFeature<GeoJSONMultiPolygon> forbiddenAreas) |
T |
setLocations(List<Location<?>> locations) |
T |
setMaximumDistanceMeters(Integer maximumDistanceMeters) |
T |
setMaximumTravelTimeSeconds(Integer maximumTravelTimeSeconds) |
T |
setModeOfTransport(ModeOfTransport modeOfTransport) |
T |
setSpeed(String speed) |
T |
setUserAffinity(Integer userAffinity) |
String |
toString() |
void |
validate()
Checks if the instance is in a valid / useful state.
|
public ModeOfTransport getModeOfTransport()
public Optional<Integer> getMaximumDistanceMeters()
RouteSegmentpublic Optional<Integer> getMaximumTravelTimeSeconds()
RouteSegmentpublic Optional<Integer> getUserAffinity()
public Optional<String> getSpeed()
Constants.Speed
or a number in kphpublic List<Location<?>> getLocations()
public Optional<GeoJSONFeature<GeoJSONMultiPolygon>> getForbiddenAreas()
public Map<String,Object> getAdditionalInfo()
ModeOfTransport.public T setModeOfTransport(ModeOfTransport modeOfTransport)
public T setForbiddenAreas(GeoJSONFeature<GeoJSONMultiPolygon> forbiddenAreas)
public static RequestModeOfTransport<?> createMinimal(ModeOfTransport modeOfTransport)
public void validate()
ValidatableIllegalArgumentException including a description of the
invalid state is thrown.validate in interface ValidatableCopyright © 2018. All rights reserved.