/** * Set the URI user info. The given user info may contain URI template variables, * and may also be {@code null} to clear the user info of this builder. * @param userInfo the URI user info * @return this UriComponentsBuilder */ @Override public UriComponentsBuilder userInfo(@Nullable String userInfo) { this.userInfo = userInfo; resetSchemeSpecificPart(); return this; }
/** * Set the URI host. The given host may contain URI template variables, * and may also be {@code null} to clear the host of this builder. * @param host the URI host * @return this UriComponentsBuilder */ @Override public UriComponentsBuilder host(@Nullable String host) { this.host = host; resetSchemeSpecificPart(); return this; }
/** * Set the URI port. Use this method only when the port needs to be * parameterized with a URI variable. Otherwise use {@link #port(int)}. * Passing {@code null} will clear the port of this builder. * @param port the URI port * @return this UriComponentsBuilder */ @Override public UriComponentsBuilder port(@Nullable String port) { this.port = port; resetSchemeSpecificPart(); return this; }
/** * Set the URI port. Passing {@code -1} will clear the port of this builder. * @param port the URI port * @return this UriComponentsBuilder */ @Override public UriComponentsBuilder port(int port) { Assert.isTrue(port >= -1, "Port must be >= -1"); this.port = String.valueOf(port); resetSchemeSpecificPart(); return this; }
/** * Set the URI user info. The given user info may contain URI template variables, * and may also be {@code null} to clear the user info of this builder. * @param userInfo the URI user info * @return this UriComponentsBuilder */ @Override public UriComponentsBuilder userInfo(@Nullable String userInfo) { this.userInfo = userInfo; resetSchemeSpecificPart(); return this; }
/** * Set the URI host. The given host may contain URI template variables, * and may also be {@code null} to clear the host of this builder. * @param host the URI host * @return this UriComponentsBuilder */ @Override public UriComponentsBuilder host(@Nullable String host) { this.host = host; resetSchemeSpecificPart(); return this; }
/** * Append the given path to the existing path of this builder. * The given path may contain URI template variables. * @param path the URI path * @return this UriComponentsBuilder */ @Override public UriComponentsBuilder path(String path) { this.pathBuilder.addPath(path); resetSchemeSpecificPart(); return this; }
/** * Append path segments to the existing path. Each path segment may contain * URI template variables and should not contain any slashes. * Use {@code path("/")} subsequently to ensure a trailing slash. * @param pathSegments the URI path segments * @return this UriComponentsBuilder */ @Override public UriComponentsBuilder pathSegment(String... pathSegments) throws IllegalArgumentException { this.pathBuilder.addPathSegments(pathSegments); resetSchemeSpecificPart(); return this; }
/** * Set the URI port. Use this method only when the port needs to be * parameterized with a URI variable. Otherwise use {@link #port(int)}. * Passing {@code null} will clear the port of this builder. * @param port the URI port * @return this UriComponentsBuilder */ @Override public UriComponentsBuilder port(@Nullable String port) { this.port = port; resetSchemeSpecificPart(); return this; }
/** * Set the URI port. Passing {@code -1} will clear the port of this builder. * @param port the URI port * @return this UriComponentsBuilder */ @Override public UriComponentsBuilder port(int port) { Assert.isTrue(port >= -1, "Port must be >= -1"); this.port = String.valueOf(port); resetSchemeSpecificPart(); return this; }
/** * Append the given query parameter to the existing query parameters. The * given name or any of the values may contain URI template variables. If no * values are given, the resulting URI will contain the query parameter name * only (i.e. {@code ?foo} instead of {@code ?foo=bar}). * @param name the query parameter name * @param values the query parameter values * @return this UriComponentsBuilder */ @Override public UriComponentsBuilder queryParam(String name, Object... values) { Assert.notNull(name, "Name must not be null"); if (!ObjectUtils.isEmpty(values)) { for (Object value : values) { String valueAsString = (value != null ? value.toString() : null); this.queryParams.add(name, valueAsString); } } else { this.queryParams.add(name, null); } resetSchemeSpecificPart(); return this; }
/** * Set the query parameter values overriding all existing query values for * the same parameter. If no values are given, the query parameter is removed. * @param name the query parameter name * @param values the query parameter values * @return this UriComponentsBuilder */ @Override public UriComponentsBuilder replaceQueryParam(String name, Object... values) { Assert.notNull(name, "Name must not be null"); this.queryParams.remove(name); if (!ObjectUtils.isEmpty(values)) { queryParam(name, values); } resetSchemeSpecificPart(); return this; }
/** * Set the query of this builder overriding all existing query parameters. * @param query the query string; a {@code null} value removes all query parameters. * @return this UriComponentsBuilder */ @Override public UriComponentsBuilder replaceQuery(@Nullable String query) { this.queryParams.clear(); if (query != null) { query(query); } resetSchemeSpecificPart(); return this; }
/** * Set the path of this builder overriding all existing path and path segment values. * @param path the URI path (a {@code null} value results in an empty path) * @return this UriComponentsBuilder */ @Override public UriComponentsBuilder replacePath(@Nullable String path) { this.pathBuilder = new CompositePathComponentBuilder(); if (path != null) { this.pathBuilder.addPath(path); } resetSchemeSpecificPart(); return this; }
/** * Append the given path to the existing path of this builder. * The given path may contain URI template variables. * @param path the URI path * @return this UriComponentsBuilder */ @Override public UriComponentsBuilder path(String path) { this.pathBuilder.addPath(path); resetSchemeSpecificPart(); return this; }
/** * Append path segments to the existing path. Each path segment may contain * URI template variables and should not contain any slashes. * Use {@code path("/")} subsequently to ensure a trailing slash. * @param pathSegments the URI path segments * @return this UriComponentsBuilder */ @Override public UriComponentsBuilder pathSegment(String... pathSegments) throws IllegalArgumentException { this.pathBuilder.addPathSegments(pathSegments); resetSchemeSpecificPart(); return this; }
this.queryParams.clear(); resetSchemeSpecificPart(); return this;
/** * Set the query of this builder overriding all existing query parameters. * @param query the query string; a {@code null} value removes all query parameters. * @return this UriComponentsBuilder */ @Override public UriComponentsBuilder replaceQuery(@Nullable String query) { this.queryParams.clear(); if (query != null) { query(query); } resetSchemeSpecificPart(); return this; }
/** * Set the path of this builder overriding all existing path and path segment values. * @param path the URI path (a {@code null} value results in an empty path) * @return this UriComponentsBuilder */ @Override public UriComponentsBuilder replacePath(@Nullable String path) { this.pathBuilder = new CompositePathComponentBuilder(); if (path != null) { this.pathBuilder.addPath(path); } resetSchemeSpecificPart(); return this; }
query(uri.getRawQuery()); resetSchemeSpecificPart();