code: @Override
      public String toUrl() {
          List<NameValuePair> params = new ArrayList<NameValuePair>(getParams());
  
          params.add(new BasicNameValuePair("start", Integer.toString(getStart())));
          params.add(new BasicNameValuePair("pagesize", Integer.toString(getPageSize())));
          params.add(new BasicNameValuePair("fetch", fetch.toString()));
  
          String order = getOrder();
          if (!order.contains("ObjectID")) {
              order += ",ObjectID";
          }
          params.add(new BasicNameValuePair("order", order));
          if (getQueryFilter() != null) {
              params.add(new BasicNameValuePair("query", getQueryFilter().toString()));
          }
  
          if (getWorkspace() != null && getWorkspace().length() > 0) {
              params.add(new BasicNameValuePair("workspace", Ref.getRelativeRef(getWorkspace())));
          }
  
          if (getProject() == null) {
              params.add(new BasicNameValuePair("project", "null"));
          } else if (getProject().length() > 0) {
              params.add(new BasicNameValuePair("project", getProject()));
              params.add(new BasicNameValuePair("projectScopeUp", Boolean.toString(isScopedUp())));
              params.add(new BasicNameValuePair("projectScopeDown", Boolean.toString(isScopedDown())));
          }
  
          return (this.type != null ? getTypeEndpoint() :
                  Ref.getRelativeRef(collection.get("_ref").getAsString())) +
                  "?" + URLEncodedUtils.format(params, "utf-8");
      }
docs: <p>Convert this request into a url compatible with the WSAPI.</p>
  The current criteria set on this request and any other parameters will be included.
  
  @return the url representing this request.