/** * @throws IllegalArgumentException * If the port parameter is outside the specified range of valid port values, which is between 0 and * 65535, inclusive. {@code -1} indicates the scheme default port. */ public URIAuthority(final String userInfo, final String hostname, final int port) { super(); Args.containsNoBlanks(hostname, "Host name"); if (userInfo != null) { Args.containsNoBlanks(userInfo, "User info"); } this.userInfo = userInfo; this.hostname = hostname.toLowerCase(Locale.ROOT); this.port = Ports.checkWithDefault(port); }
/** * @throws IllegalArgumentException * If the port parameter is outside the specified range of valid port values, which is between 0 and * 65535, inclusive. {@code -1} indicates the scheme default port. */ public URIAuthority(final String userInfo, final String hostname, final int port) { super(); Args.containsNoBlanks(hostname, "Host name"); if (userInfo != null) { Args.containsNoBlanks(userInfo, "User info"); } this.userInfo = userInfo; this.hostname = hostname.toLowerCase(Locale.ROOT); this.port = Ports.checkWithDefault(port); }
public Host(final String name, final int port) { super(); this.name = Args.containsNoBlanks(name, "Host name"); this.port = Ports.check(port); this.lcName = this.name.toLowerCase(Locale.ROOT); }
public Host(final String name, final int port) { super(); this.name = Args.containsNoBlanks(name, "Host name"); this.port = Ports.check(port); this.lcName = this.name.toLowerCase(Locale.ROOT); }
/** * Creates {@code HttpHost} instance with the given scheme, hostname and port. * @param scheme the name of the scheme. * {@code null} indicates the * {@link #DEFAULT_SCHEME default scheme} * @param hostname the hostname (IP or DNS name) * @param port the port number. * {@code -1} indicates the scheme default port. * * @throws IllegalArgumentException * If the port parameter is outside the specified range of valid port values, which is between 0 and * 65535, inclusive. {@code -1} indicates the scheme default port. */ public HttpHost(final String scheme, final String hostname, final int port) { super(); this.hostname = Args.containsNoBlanks(hostname, "Host name"); this.lcHostname = hostname.toLowerCase(Locale.ROOT); if (scheme != null) { this.schemeName = scheme.toLowerCase(Locale.ROOT); } else { this.schemeName = DEFAULT_SCHEME.id; } this.port = Ports.checkWithDefault(port); this.address = null; }
/** * Creates a new {@link HttpHost HttpHost}, specifying all values. * Constructor for HttpHost. * @param scheme the name of the scheme. * {@code null} indicates the * {@link #DEFAULT_SCHEME default scheme} * @param address the inet address. Can be {@code null} * @param hostname the hostname (IP or DNS name) * @param port the port number. * {@code -1} indicates the scheme default port. * * @throws IllegalArgumentException * If the port parameter is outside the specified range of valid port values, which is between 0 and * 65535, inclusive. {@code -1} indicates the scheme default port. * * @since 5.0 */ public HttpHost(final String scheme, final InetAddress address, final String hostname, final int port) { this.hostname = Args.containsNoBlanks(hostname, "Host name"); this.port = Ports.checkWithDefault(port); this.lcHostname = hostname.toLowerCase(Locale.ROOT); if (scheme != null) { this.schemeName = scheme.toLowerCase(Locale.ROOT); } else { this.schemeName = DEFAULT_SCHEME.id; } this.address = address; }