'Create a new URLParameters instance.
:param str url: The URL value'

def __init__(self, url):

    super(URLParameters, self).__init__()
    self._all_url_query_values = None
    if (url[0:4].lower() == 'amqp'):
        url = ('http' + url[4:])
    parts = urlparse.urlparse(url)
    if (parts.scheme == 'https'):
        self.ssl = True
    elif (parts.scheme == 'http'):
        self.ssl = False
    elif parts.scheme:
        raise ValueError(('Unexpected    URL    scheme    %r;    supported    scheme    values:    amqp,    amqps' % (parts.scheme,)))
    if (parts.hostname is not None):
        self.host = parts.hostname
    if (parts.port is not None):
        self.port = parts.port
    else:
        self.port = (self.DEFAULT_SSL_PORT if self.ssl else self.DEFAULT_PORT)
    if (parts.username is not None):
        self.credentials = pika_credentials.PlainCredentials(url_unquote(parts.username), url_unquote(parts.password))
    if (len(parts.path) > 1):
        self.virtual_host = url_unquote(parts.path.split('/')[1])
    self._all_url_query_values = urlparse.parse_qs(parts.query)
    for (name, value) in dict_iteritems(self._all_url_query_values):
        try:
            set_value = getattr(self, (self._SETTER_PREFIX + name))
        except AttributeError:
            raise ValueError(('Unknown    URL    parameter:    %r' % (name,)))
        try:
            (value,) = value
        except ValueError:
            raise ValueError(('Expected    exactly    one    value    for    URL    parameter    %s,    but    got    %i    values:    %s' % (name, len(value), value)))
        set_value(value)
