public static HostAndPort fromParts ( String host , int port ) { checkArgument ( isValidPort ( port ) , "Port out of range: %s" , port ) ; HostAndPort parsedHost = fromString ( host ) ; checkArgument ( ! parsedHost . hasPort ( ) , "Host has a port: %s" , host ) ; return new HostAndPort ( parsedHost . host , port , parsedHost . hasBracketlessColons ) ; }
Build a HostAndPort instance from separate host and port values .