public String toUrlQueryString(String prefix) {
    String suffix = "";
    String containerSuffix = "";
    String containerPrefix = "";
    if (prefix == null) {
      // style=form, explode=true, e.g. /pet?name=cat&type=manx
      prefix = "";
    } else {
      // deepObject style e.g. /pet?id[name]=cat&id[type]=manx
      prefix = prefix + "[";
      suffix = "]";
      containerSuffix = "]";
      containerPrefix = "[";
    }

    StringJoiner joiner = new StringJoiner("&");

    // add `nodeClass` to the URL query string
    if (getNodeClass() != null) {
      try {
        joiner.add(String.format("%snodeClass%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNodeClass()), "UTF-8").replaceAll("\\+", "%20")));
      } catch (UnsupportedEncodingException e) {
        // Should never happen, UTF-8 is always supported
        throw new RuntimeException(e);
      }
    }

    // add `operations` to the URL query string
    if (getOperations() != null) {
      joiner.add(getOperations().toUrlQueryString(prefix + "operations" + suffix));
    }

    // add `description` to the URL query string
    if (getDescription() != null) {
      try {
        joiner.add(String.format("%sdescription%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDescription()), "UTF-8").replaceAll("\\+", "%20")));
      } catch (UnsupportedEncodingException e) {
        // Should never happen, UTF-8 is always supported
        throw new RuntimeException(e);
      }
    }

    // add `descriptionUrl` to the URL query string
    if (getDescriptionUrl() != null) {
      try {
        joiner.add(String.format("%sdescriptionUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDescriptionUrl()), "UTF-8").replaceAll("\\+", "%20")));
      } catch (UnsupportedEncodingException e) {
        // Should never happen, UTF-8 is always supported
        throw new RuntimeException(e);
      }
    }

    // add `displayName` to the URL query string
    if (getDisplayName() != null) {
      try {
        joiner.add(String.format("%sdisplayName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDisplayName()), "UTF-8").replaceAll("\\+", "%20")));
      } catch (UnsupportedEncodingException e) {
        // Should never happen, UTF-8 is always supported
        throw new RuntimeException(e);
      }
    }

    // add `displayFormat` to the URL query string
    if (getDisplayFormat() != null) {
      try {
        joiner.add(String.format("%sdisplayFormat%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDisplayFormat()), "UTF-8").replaceAll("\\+", "%20")));
      } catch (UnsupportedEncodingException e) {
        // Should never happen, UTF-8 is always supported
        throw new RuntimeException(e);
      }
    }

    // add `unit` to the URL query string
    if (getUnit() != null) {
      try {
        joiner.add(String.format("%sunit%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUnit()), "UTF-8").replaceAll("\\+", "%20")));
      } catch (UnsupportedEncodingException e) {
        // Should never happen, UTF-8 is always supported
        throw new RuntimeException(e);
      }
    }

    // add `extensions` to the URL query string
    if (getExtensions() != null) {
      for (int i = 0; i < getExtensions().size(); i++) {
        if (getExtensions().get(i) != null) {
          joiner.add(getExtensions().get(i).toUrlQueryString(String.format("%sextensions%s%s", prefix, suffix,
              "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix))));
        }
      }
    }

    // add `references` to the URL query string
    if (getReferences() != null) {
      for (int i = 0; i < getReferences().size(); i++) {
        if (getReferences().get(i) != null) {
          joiner.add(getReferences().get(i).toUrlQueryString(String.format("%sreferences%s%s", prefix, suffix,
              "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix))));
        }
      }
    }

    return joiner.toString();
  }
Convert the instance into URL query string.

@param prefix prefix of the query string
@return URL query string
plc4j/drivers/ctrlx/src/main/java/org/apache/plc4x/java/ctrlx/readwrite/rest/datalayer/model/MetaData.java