private URI _build(boolean encode, Object... values) {
    if (values == null || values.length == 0) {
      return createURI(create());
    }

    if (ssp != null) {
      throw new IllegalArgumentException("Schema specific part is opaque");
    }

    encodeMatrix();
    encodeQuery();

    String uri =
        UriTemplate.createURI(
            scheme,
            authority,
            userInfo,
            host,
            (port != -1) ? String.valueOf(port) : null,
            path.toString(),
            query.toString(),
            fragment,
            values,
            encode);
    return createURI(uri);
  }
Example #2
0
  private URI _buildFromMap(boolean encode, Map<String, ? extends Object> values) {
    if (ssp != null) throw new IllegalArgumentException("Schema specific part is opaque");

    encodeMatrix();
    encodeQuery();

    String uri =
        UriTemplate.createURI(
            scheme,
            authority,
            userInfo,
            host,
            (port != -1) ? String.valueOf(port) : null,
            path.toString(),
            query.toString(),
            fragment,
            values,
            encode);
    return createURI(uri);
  }