class Transformers {

   public static PlatformMessage requestToMessage(Request req, UUID placeId, String population, int ttl) {
      Preconditions.checkNotNull(req, "req must not be null");
      Preconditions.checkNotNull(req.getInputs(), "inputs must not be null");
      Preconditions.checkArgument(req.getInputs().size() == 1, "inputs must be of length 1");
      MessageBody body;
      Request.Input input = req.getInputs().get(0);
      switch(input.getIntent()) {
         case Constants.Intents.SYNC:
            body = inputToSyncMessage();
            break;
         case Constants.Intents.QUERY:
            body = inputToQueryMessage(input.getPayload());
            break;
         case Constants.Intents.EXECUTE:
            body = inputToExecuteMessage(input.getPayload());
            break;
         default:
            body = null;
            break;
      }
      if(body == null) {
         throw new ErrorEventException(Constants.Error.NOT_SUPPORTED, "unknown intent " + input.getIntent());
      }
      return PlatformMessage.buildRequest(body, Constants.BRIDGE_ADDRESS, Constants.SERVICE_ADDRESS)
            .withTimeToLive(ttl)
            .withCorrelationId(req.getRequestId())
            .withPlaceId(placeId)
            .withPopulation(population)
            .create();
   }

   private  Transformers();

}