@classmethod
def from_string(cls, string):
    """Generate a Parameter from a query string snippet.

        Args:
            string (str): The snippet of a URL which contains a query
                parameter. Ex: id=1,2,3,$NONE

        Raises:
            ValueError: If the string is not a query string.

        Returns:
            AnyParameter: If the $ANY special token is anywhere in the value.
            SingleParameter: If there is only one value.
            MultiParameter: If there are multiple values.
        """
    if string.count('=') > 1:
        raise ValueError('Invalid query parameter string')
    if string.startswith('?'):
        string = string[1:]
    field, value = string.split('=')
    return cls(field, value)
