MCPcopy Create free account
hub / github.com/grpc/grpc-java / setHost

Method setHost

api/src/main/java/io/grpc/Uri.java:904–912  ·  view source on GitHub ↗

Specifies the "host" component of the new URI in its "registered name" form (usually DNS), e.g. "server.com". The registered name can contain any string of codepoints. Codepoints that can't be encoded literally will be percent-encoded for you as UTF-8. This field is optional. @param regName

(@Nullable String regName)

Source from the content-addressed store, hash-verified

902 * @return this, for fluent building
903 */
904 @CanIgnoreReturnValue
905 public Builder setHost(@Nullable String regName) {
906 if (regName != null) {
907 regName = regName.toLowerCase(Locale.ROOT);
908 regName = percentEncode(regName, regNameChars);
909 }
910 this.host = regName;
911 return this;
912 }
913
914 /**
915 * Specifies the "host" component of the new URI as an IP address.

Calls 2

toUriStringMethod · 0.95
percentEncodeMethod · 0.80