docs: public String encode() throws IOException {
          FastStringWriter fsw = new FastStringWriter();
          boolean hasComma = false;
          String preString;
  
          try {
              if (this.point != null) {
                  fsw.write("\"point\":{");
                  fsw.write(this.point.encode());
                  fsw.write("}");
  
                  hasComma = true;
              }
  
              if (this.line != null) {
                  preString = hasComma ? "," : "";
                  fsw.write(preString + "\"line\":{");
                  fsw.write(this.line.encode());
                  fsw.write("}");
  
                  hasComma = true;
              }
  
              if (this.rectangle != null) {
                  preString = hasComma ? "," : "";
                  fsw.write(preString + "\"rectangle\":{");
                  fsw.write(this.rectangle.encode());
                  fsw.write("}");
  
                  hasComma = true;
              }
  
              if (this.arc != null) {
                  preString = hasComma ? "," : "";
                  fsw.write(preString + "\"arc\":{");
                  fsw.write(this.arc.encode());
                  fsw.write("}");
              }
          }
          finally {
              fsw.close();
          }
  
          return fsw.toString();
      }