private static <T> void writeFeature(
            String key, T value, long subqueryBitmap, JsonGenerator g, ValueWriter<T> valueWriter)
            throws IOException {

        g.writeStartObject();
        g.writeStringField("k", key);
        valueWriter.write(g, "v", value);
        if (subqueryBitmap != SubqueryBitmap.DEFAULT_VALUE) {
            g.writeStringField("s", toHexString(subqueryBitmap));
        }
        g.writeEndObject();
    }
Converts {@link PredicateQuery} to and from JSON

Example:
 {
     features: [
         {"k": "key-name", "v":"value", "s":"0xDEADBEEFDEADBEEF"}
     ],
     rangeFeatures: [
         {"k": "key-name", "v":42, "s":"0xDEADBEEFDEADBEEF"}
     ]
 }

@author bjorncs
predicate-search/src/main/java/com/yahoo/search/predicate/serialization/PredicateQuerySerializer.java