Class JacksonRequestConfigurator

java.lang.Object
com.targomo.client.api.request.config.JacksonRequestConfigurator

public final class JacksonRequestConfigurator extends Object
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

      public static String getConfig(TravelOptions travelOptions) throws TargomoClientException
      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