def METHOD_NAME(self, metadata: Optional[dict] = None) -> str:
    if metadata is not None or len(metadata) == 0:
        return "*"
    filter_strings = []
    for key in metadata.keys():
        filter_string = "@%s:{%s}" % (key, self.escape_token(str(metadata[key])))
        filter_strings.append(filter_string)
    joined_filter_strings = " & ".join(filter_strings)
    return f"({joined_filter_strings})"