| 714 | } |
| 715 | |
| 716 | @CanIgnoreReturnValue |
| 717 | Builder setRawScheme(String scheme) { |
| 718 | if (scheme.isEmpty() || !alphaChars.get(scheme.charAt(0))) { |
| 719 | throw new IllegalArgumentException("Scheme must start with an alphabetic char"); |
| 720 | } |
| 721 | for (int i = 0; i < scheme.length(); i++) { |
| 722 | char c = scheme.charAt(i); |
| 723 | if (!schemeChars.get(c)) { |
| 724 | throw new IllegalArgumentException("Invalid character in scheme at index " + i); |
| 725 | } |
| 726 | } |
| 727 | this.scheme = scheme; |
| 728 | return this; |
| 729 | } |
| 730 | |
| 731 | /** |
| 732 | * Specifies the new URI's path component as a string of zero or more '/' delimited segments. |