34
34
/**
35
35
* Builder for {@link UriComponents}.
36
36
*
37
- * <p></p> Typical usage involves:
37
+ * <p>Typical usage involves:
38
38
* <ol>
39
- * <li>Create a {@code UriComponentsBuilder} with one of the static factory methods (such as
40
- * {@link #fromPath(String)} or {@link #fromUri(URI)})</li>
41
- * <li>Set the various URI components through the respective methods ({@link #scheme(String)},
42
- * {@link #userInfo(String)}, {@link #host(String)}, {@link #port(int)}, {@link #path(String)},
43
- * {@link #pathSegment(String...)}, {@link #queryParam(String, Object...)}, and
44
- * {@link #fragment(String)}.</li>
45
- * <li>Build the {@link UriComponents} instance with the {@link #build()} method.</li>
39
+ * <li>Create a {@code UriComponentsBuilder} with one of the static factory methods
40
+ * (such as {@link #fromPath(String)} or {@link #fromUri(URI)})</li>
41
+ * <li>Set the various URI components through the respective methods ({@link #scheme(String)},
42
+ * {@link #userInfo(String)}, {@link #host(String)}, {@link #port(int)}, {@link #path(String)},
43
+ * {@link #pathSegment(String...)}, {@link #queryParam(String, Object...)}, and
44
+ * {@link #fragment(String)}.</li>
45
+ * <li>Build the {@link UriComponents} instance with the {@link #build()} method.</li>
46
46
* </ol>
47
47
*
48
48
* @author Arjen Poutsma
@@ -303,7 +303,7 @@ public UriComponents buildAndExpand(Object... uriVariableValues) {
303
303
// URI components methods
304
304
305
305
/**
306
- * Initializes all components of this URI builder with the components of the given URI.
306
+ * Initialize all components of this URI builder with the components of the given URI.
307
307
* @param uri the URI
308
308
* @return this UriComponentsBuilder
309
309
*/
@@ -352,7 +352,7 @@ private void resetSchemeSpecificPart() {
352
352
}
353
353
354
354
/**
355
- * Sets the URI scheme. The given scheme may contain URI template variables,
355
+ * Set the URI scheme. The given scheme may contain URI template variables,
356
356
* and may also be {@code null} to clear the scheme of this builder.
357
357
* @param scheme the URI scheme
358
358
* @return this UriComponentsBuilder
@@ -421,9 +421,8 @@ public UriComponentsBuilder schemeSpecificPart(String ssp) {
421
421
}
422
422
423
423
/**
424
- * Sets the URI user info. The given user info may contain URI template
425
- * variables, and may also be {@code null} to clear the user info of this
426
- * builder.
424
+ * Set the URI user info. The given user info may contain URI template variables,
425
+ * and may also be {@code null} to clear the user info of this builder.
427
426
* @param userInfo the URI user info
428
427
* @return this UriComponentsBuilder
429
428
*/
@@ -434,8 +433,8 @@ public UriComponentsBuilder userInfo(String userInfo) {
434
433
}
435
434
436
435
/**
437
- * Sets the URI host. The given host may contain URI template variables, and
438
- * may also be {@code null} to clear the host of this builder.
436
+ * Set the URI host. The given host may contain URI template variables,
437
+ * and may also be {@code null} to clear the host of this builder.
439
438
* @param host the URI host
440
439
* @return this UriComponentsBuilder
441
440
*/
@@ -446,7 +445,7 @@ public UriComponentsBuilder host(String host) {
446
445
}
447
446
448
447
/**
449
- * Sets the URI port. Passing {@code -1} will clear the port of this builder.
448
+ * Set the URI port. Passing {@code -1} will clear the port of this builder.
450
449
* @param port the URI port
451
450
* @return this UriComponentsBuilder
452
451
*/
@@ -458,8 +457,8 @@ public UriComponentsBuilder port(int port) {
458
457
}
459
458
460
459
/**
461
- * Appends the given path to the existing path of this builder. The given
462
- * path may contain URI template variables.
460
+ * Append the given path to the existing path of this builder.
461
+ * The given path may contain URI template variables.
463
462
* @param path the URI path
464
463
* @return this UriComponentsBuilder
465
464
*/
@@ -470,7 +469,7 @@ public UriComponentsBuilder path(String path) {
470
469
}
471
470
472
471
/**
473
- * Sets the path of this builder overriding all existing path and path segment values.
472
+ * Set the path of this builder overriding all existing path and path segment values.
474
473
* @param path the URI path; a {@code null} value results in an empty path.
475
474
* @return this UriComponentsBuilder
476
475
*/
@@ -481,8 +480,8 @@ public UriComponentsBuilder replacePath(String path) {
481
480
}
482
481
483
482
/**
484
- * Appends the given path segments to the existing path of this builder. Each given
485
- * path segments may contain URI template variables.
483
+ * Append the given path segments to the existing path of this builder.
484
+ * Each given path segment may contain URI template variables.
486
485
* @param pathSegments the URI path segments
487
486
* @return this UriComponentsBuilder
488
487
*/
@@ -494,7 +493,7 @@ public UriComponentsBuilder pathSegment(String... pathSegments) throws IllegalAr
494
493
}
495
494
496
495
/**
497
- * Appends the given query to the existing query of this builder.
496
+ * Append the given query to the existing query of this builder.
498
497
* The given query may contain URI template variables.
499
498
* <p><strong>Note:</strong> The presence of reserved characters can prevent
500
499
* correct parsing of the URI string. For example if a query parameter
@@ -527,7 +526,7 @@ public UriComponentsBuilder query(String query) {
527
526
}
528
527
529
528
/**
530
- * Sets the query of this builder overriding all existing query parameters.
529
+ * Set the query of this builder overriding all existing query parameters.
531
530
* @param query the query string; a {@code null} value removes all query parameters.
532
531
* @return this UriComponentsBuilder
533
532
*/
@@ -539,7 +538,7 @@ public UriComponentsBuilder replaceQuery(String query) {
539
538
}
540
539
541
540
/**
542
- * Appends the given query parameter to the existing query parameters. The
541
+ * Append the given query parameter to the existing query parameters. The
543
542
* given name or any of the values may contain URI template variables. If no
544
543
* values are given, the resulting URI will contain the query parameter name
545
544
* only (i.e. {@code ?foo} instead of {@code ?foo=bar}.
@@ -563,7 +562,7 @@ public UriComponentsBuilder queryParam(String name, Object... values) {
563
562
}
564
563
565
564
/**
566
- * Adds the given query parameters.
565
+ * Add the given query parameters.
567
566
* @param params the params
568
567
* @return this UriComponentsBuilder
569
568
*/
@@ -574,9 +573,8 @@ public UriComponentsBuilder queryParams(MultiValueMap<String, String> params) {
574
573
}
575
574
576
575
/**
577
- * Sets the query parameter values overriding all existing query values for
578
- * the same parameter. If no values are given, the query parameter is
579
- * removed.
576
+ * Set the query parameter values overriding all existing query values for
577
+ * the same parameter. If no values are given, the query parameter is removed.
580
578
* @param name the query parameter name
581
579
* @param values the query parameter values
582
580
* @return this UriComponentsBuilder
@@ -592,9 +590,8 @@ public UriComponentsBuilder replaceQueryParam(String name, Object... values) {
592
590
}
593
591
594
592
/**
595
- * Sets the URI fragment. The given fragment may contain URI template
596
- * variables, and may also be {@code null} to clear the fragment of this
597
- * builder.
593
+ * Set the URI fragment. The given fragment may contain URI template variables,
594
+ * and may also be {@code null} to clear the fragment of this builder.
598
595
* @param fragment the URI fragment
599
596
* @return this UriComponentsBuilder
600
597
*/
@@ -615,6 +612,7 @@ private interface PathComponentBuilder {
615
612
PathComponent build ();
616
613
}
617
614
615
+
618
616
private static class CompositePathComponentBuilder implements PathComponentBuilder {
619
617
620
618
private final LinkedList <PathComponentBuilder > componentBuilders = new LinkedList <PathComponentBuilder >();
0 commit comments