Class RequestConfigurator
java.lang.Object
com.targomo.client.api.request.config.RequestConfigurator
Parse TravelOptions into JSON strings that can be used when calling client methods.
Targets are generated using StringBuilders for faster generation.
Polygon, sources array and other properties are created as JSONObjects, then appended as Strings.
-
Method Details
-
getConfig
Replaces getCfg methods of Request classes. Output should be encoded as URL if request method will be GET- Parameters:
travelOptions- Travel options to be parsed into JSON- Returns:
- JSON output
- Throws:
TargomoClientException- Thrown when JSON cannot be generated
-
getConfig
public static String getConfig(Map<String, CriterionDefinition> criteria, List<Location> locations, List<Location> competitors) throws TargomoClientException- Throws:
TargomoClientException
-
getConfig
public static String getConfig(List<Location> locations, List<Location> competitors) throws TargomoClientException - Throws:
TargomoClientException
-