public URI toURI ( ) throws URISyntaxException { final String scheme = traverse ( this , UriBuilder :: getParent , UriBuilder :: getScheme , Traverser :: notNull ) ; final Integer port = traverse ( this , UriBuilder :: getParent , UriBuilder :: getPort , notValue ( DEFAULT_PORT ) ) ; final String host = traverse ( this , UriBuilder :: getParent , UriBuilder :: getHost , Traverser :: notNull ) ; final GString path = traverse ( this , UriBuilder :: getParent , UriBuilder :: getPath , Traverser :: notNull ) ; final String query = populateQueryString ( traverse ( this , UriBuilder :: getParent , UriBuilder :: getQuery , Traverser :: nonEmptyMap ) ) ; final String fragment = traverse ( this , UriBuilder :: getParent , UriBuilder :: getFragment , Traverser :: notNull ) ; final String userInfo = traverse ( this , UriBuilder :: getParent , UriBuilder :: getUserInfo , Traverser :: notNull ) ; final Boolean useRaw = traverse ( this , UriBuilder :: getParent , UriBuilder :: getUseRawValues , Traverser :: notNull ) ; if ( useRaw != null && useRaw ) { return toRawURI ( scheme , port , host , path , query , fragment , userInfo ) ; } else { return new URI ( scheme , userInfo , host , ( port == null ? - 1 : port ) , ( ( path == null ) ? null : path . toString ( ) ) , query , fragment ) ; } }
Converts the parts of the UriBuilder to the URI object instance .