C# Class FluentUri.FluentUriBuilder

ファイルを表示 Open project: balazsbotond/FluentUriBuilder

Public Methods

Method Description
Create ( ) : FluentUriBuilder
Credentials ( string user, string password ) : FluentUriBuilder

Sets or updates the user credentials (user name and password) in the URI.

DefaultPort ( ) : FluentUriBuilder

Updates the URI to use the default port for the protocol.

Fragment ( string fragment ) : FluentUriBuilder

Sets or updates the fragment part of the URI.

From ( string baseUri ) : FluentUriBuilder
Host ( string host ) : FluentUriBuilder

Sets or updates the hostname of the URI.

Path ( string path ) : FluentUriBuilder

Sets or updates the local path in the URI.

Port ( int port ) : FluentUriBuilder

Sets or updates the port number in the URI.

QueryParam ( string key, string value ) : FluentUriBuilder

Adds a query parameter to the URI.

QueryParams ( object>.IDictionary queryParams ) : FluentUriBuilder

Sets the query parameters of the URI.

QueryParams ( object queryParams ) : FluentUriBuilder

Sets the query parameters of the URI.

RemoveCredentials ( ) : FluentUriBuilder

Removes the user name and password from the URI.

RemoveFragment ( ) : FluentUriBuilder

Removes the fragment part of the URI.

RemovePath ( ) : FluentUriBuilder

Removes the local path from the URI.

RemovePort ( ) : FluentUriBuilder

Removes the port number from the URI.

RemoveQueryParams ( ) : FluentUriBuilder

Removes all query parameters from the URI.

Scheme ( UriScheme scheme ) : FluentUriBuilder

Sets or updates the protocol scheme of the URI.

ToString ( ) : string

Returns the URI build by this instance as a string.

ToUri ( ) : Uri

Creates a new Uri instance from the values specified.

Private Methods

Method Description
FluentUriBuilder ( string baseUri ) : System
initializeQueryParamsList ( ) : void

Method Details

Create() public static method

public static Create ( ) : FluentUriBuilder
return FluentUriBuilder

Credentials() public method

Sets or updates the user credentials (user name and password) in the URI.
/// If either of the arguments specified is null. ///
public Credentials ( string user, string password ) : FluentUriBuilder
user string /// The new value of the user. ///
password string /// The new value of the password. ///
return FluentUriBuilder

DefaultPort() public method

Updates the URI to use the default port for the protocol.
public DefaultPort ( ) : FluentUriBuilder
return FluentUriBuilder

Fragment() public method

Sets or updates the fragment part of the URI.
/// If the fragment specified is null. ///
public Fragment ( string fragment ) : FluentUriBuilder
fragment string /// The new value of the URI fragment. If empty, the base URI fragment is deleted. ///
return FluentUriBuilder

From() public static method

public static From ( string baseUri ) : FluentUriBuilder
baseUri string
return FluentUriBuilder

Host() public method

Sets or updates the hostname of the URI.
/// If the hostname specified is a null or empty , /// or it only contains white space. ///
public Host ( string host ) : FluentUriBuilder
host string /// The new value of the hostname. Cannot be null or white space. ///
return FluentUriBuilder

Path() public method

Sets or updates the local path in the URI.
public Path ( string path ) : FluentUriBuilder
path string /// The new value of the local path. ///
return FluentUriBuilder

Port() public method

Sets or updates the port number in the URI.
/// If is less than -1 or greater than 65535. ///
public Port ( int port ) : FluentUriBuilder
port int /// An integer between -1 and 65535, inclusive. -1 indicates that the default /// port number for the protocol is to be used. ///
return FluentUriBuilder

QueryParam() public method

Adds a query parameter to the URI.
/// If either or is null or empty. ///
public QueryParam ( string key, string value ) : FluentUriBuilder
key string /// The key (name) of the query parameter. ///
value string /// The value of the query parameter. ///
return FluentUriBuilder

QueryParams() public method

Sets the query parameters of the URI.
/// If is null; ///
public QueryParams ( object>.IDictionary queryParams ) : FluentUriBuilder
queryParams object>.IDictionary /// The query parameters to add to the URI. ///
return FluentUriBuilder

QueryParams() public method

Sets the query parameters of the URI.
/// If is null; ///
public QueryParams ( object queryParams ) : FluentUriBuilder
queryParams object /// The object containing the query parameters to add to the URI. Property names /// and their values are used as parameter keys and values. ///
return FluentUriBuilder

RemoveCredentials() public method

Removes the user name and password from the URI.
public RemoveCredentials ( ) : FluentUriBuilder
return FluentUriBuilder

RemoveFragment() public method

Removes the fragment part of the URI.
public RemoveFragment ( ) : FluentUriBuilder
return FluentUriBuilder

RemovePath() public method

Removes the local path from the URI.
public RemovePath ( ) : FluentUriBuilder
return FluentUriBuilder

RemovePort() public method

Removes the port number from the URI.
public RemovePort ( ) : FluentUriBuilder
return FluentUriBuilder

RemoveQueryParams() public method

Removes all query parameters from the URI.
public RemoveQueryParams ( ) : FluentUriBuilder
return FluentUriBuilder

Scheme() public method

Sets or updates the protocol scheme of the URI.
public Scheme ( UriScheme scheme ) : FluentUriBuilder
scheme UriScheme /// The new value of the protocol scheme. ///
return FluentUriBuilder

ToString() public method

Returns the URI build by this instance as a string.
public ToString ( ) : string
return string

ToUri() public method

Creates a new Uri instance from the values specified.
public ToUri ( ) : Uri
return System.Uri