code: public PolygonTo toTransferObject(Polygon input) {
          PolygonTo result = new PolygonTo();
          result.setCrs(GeoJsonTo.createCrsTo("EPSG:" + input.getSRID()));
          double[][][] rings = new double[input.getNumInteriorRing() + 1][][];
          // Exterior ring:
          rings[0] = getPoints(input.getExteriorRing());
          // Interior rings!
          for (int i = 0; i < input.getNumInteriorRing(); i++) {
              rings[i + 1] = getPoints(input.getInteriorRingN(i));
          }
          result.setCoordinates(rings);
          return result;
      }
docs: Converts a polygon to its corresponding Transfer Object
  
  @param input a polygon object
  @return a transfer object for the polygon