src/main/java/de/qaware/xff/util/uri/HierarchicalUriComponents.java
/**
	 * Encode all URI components using their specific encoding rules and return
	 * the result as a new {@code UriComponents} instance.
	 *
	 * @param charset the encoding of the values
	 * @return the encoded URI components
	 */
Encode all URI components using their specific encoding rules and return
the result as a new  UriComponents instance.

@param charset the encoding of the values
@return the encoded URI components
Encode all URI components using their specific encoding rules and return the result as a new UriComponents instance . @param charset the encoding of the values @return the encoded URI components
@Override
	public HierarchicalUriComponents encode(Charset charset) {
		if (this.encoded) {
			return this;
		}
		String scheme = getScheme();
		String fragment = getFragment();
		String schemeTo = (scheme != null ? encodeUriComponent(scheme, charset, URIComponentType.SCHEME) : null);
		String fragmentTo = (fragment != null ? encodeUriComponent(fragment, charset, URIComponentType.FRAGMENT) : null);
		String userInfoTo = (this.userInfo != null ? encodeUriComponent(this.userInfo, charset, URIComponentType.USER_INFO) : null);
		String hostTo = (this.host != null ? encodeUriComponent(this.host, charset, getHostType()) : null);
		PathComponent pathTo = this.path.encode(charset);
		MultiValuedMap<String, String> paramsTo = encodeQueryParams(charset);
		return new HierarchicalUriComponents(schemeTo, fragmentTo, userInfoTo, hostTo, this.port,
				pathTo, paramsTo, true, false);
	}
@ Override public HierarchicalUriComponents encode ( Charset charset ) { if ( this . encoded ) { return this ; } String scheme = getScheme ( ) ; String fragment = getFragment ( ) ; String schemeTo = ( scheme != null ? encodeUriComponent ( scheme , charset , URIComponentType . SCHEME ) : null ) ; String fragmentTo = ( fragment != null ? encodeUriComponent ( fragment , charset , URIComponentType . FRAGMENT ) : null ) ; String userInfoTo = ( this . userInfo != null ? encodeUriComponent ( this . userInfo , charset , URIComponentType . USER_INFO ) : null ) ; String hostTo = ( this . host != null ? encodeUriComponent ( this . host , charset , getHostType ( ) ) : null ) ; PathComponent pathTo = this . path . encode ( charset ) ; MultiValuedMap < String , String > paramsTo = encodeQueryParams ( charset ) ; return new HierarchicalUriComponents ( schemeTo , fragmentTo , userInfoTo , hostTo , this . port , pathTo , paramsTo , true , false ) ; }
Encode all URI components using their specific encoding rules and return
 the result as a new {@code UriComponents} instance.
Encode all URI components using their specific encoding rules and return the result as a new { @code UriComponents } instance .