code: public String toJson() {
      GsonBuilder gson = new GsonBuilder();
      gson.registerTypeAdapterFactory(DirectionsAdapterFactory.create());
      gson.registerTypeAdapter(Point.class, new PointAsCoordinatesTypeAdapter());
      return gson.create().toJson(this);
    }
docs: This takes the currently defined values found inside this instance and converts it to a json
  string.
  
  @return a JSON string which represents this DirectionsJsonObject
  @since 3.4.0