public static String withKey(String key, Selector selector) {
        return String.format("\"%s\": %s", key, enclose(selector));
    }
public static String withKey ( String key , Selector selector ) { return String . format ( "\"%s\": %s" , key , enclose ( selector ) ) ; }
<P>
Returns the string form of the specified key mapping to a JSON object enclosing the selector.
</P>
<pre>
{@code
Selector selector = eq("year", 2017);
System.out.println(selector.toString());
// Output: "year": {"$eq" : 2017}
System.out.println(SelectorUtils.withKey("selector", selector));
// Output: "selector": {"year": {"$eq": 2017}}
}
</pre>

@param key      key to use for the selector (usually "selector" or "partial_filter_selector")
@param selector the selector
@return the string form of the selector enclosed in a JSON object, keyed by key