src/main/java/com/arpnetworking/logback/serialization/steno/StenoSerializationHelper.java
public static void writeKeyValuePairs(
            @Nullable final List<String> keys,
            @Nullable final List<Object> values,
            final JsonGenerator jsonGenerator,
            final ObjectMapper objectMapper,
            final StenoEncoder encoder)
            throws IOException {
        if (keys != null) {
            final int contextValuesLength = values == null ? 0 : values.size();
            for (int i = 0; i < keys.size(); ++i) {
                final String key = keys.get(i);
                if (i >= contextValuesLength) {
                    jsonGenerator.writeObjectField(key, null);
                } else {
                    final Object value = values.get(i);
                    if (isSimpleType(value)) {
                        jsonGenerator.writeObjectField(key, value);
                    } else {
                        jsonGenerator.writeFieldName(key);
                        objectMapper.writeValue(
                                jsonGenerator,
                                value);
                    }
                }
            }
        }
    }
public static void writeKeyValuePairs(
            @Nullable final List<String> keys,
            @Nullable final List<Object> values,
            final JsonGenerator jsonGenerator,
            final ObjectMapper objectMapper,
            final StenoEncoder encoder)
            throws IOException {
        if (keys != null) {
            final int contextValuesLength = values == null ? 0 : values.size();
            for (int i = 0; i < keys.size(); ++i) {
                final String key = keys.get(i);
                if (i >= contextValuesLength) {
                    jsonGenerator.writeObjectField(key, null);
                } else {
                    final Object value = values.get(i);
                    if (isSimpleType(value)) {
                        jsonGenerator.writeObjectField(key, value);
                    } else {
                        jsonGenerator.writeFieldName(key);
                        objectMapper.writeValue(
                                jsonGenerator,
                                value);
                    }
                }
            }
        }
    }
public static void writeKeyValuePairs ( @ Nullable final List < String > keys , @ Nullable final List < Object > values , final JsonGenerator jsonGenerator , final ObjectMapper objectMapper , final StenoEncoder encoder ) throws IOException { if ( keys != null ) { final int contextValuesLength = values == null ? 0 : values . size ( ) ; for ( int i = 0 ; i < keys . size ( ) ; ++ i ) { final String key = keys . get ( i ) ; if ( i >= contextValuesLength ) { jsonGenerator . writeObjectField ( key , null ) ; } else { final Object value = values . get ( i ) ; if ( isSimpleType ( value ) ) { jsonGenerator . writeObjectField ( key , value ) ; } else { jsonGenerator . writeFieldName ( key ) ; objectMapper . writeValue ( jsonGenerator , value ) ; } } } } }
Write specified key-value pairs into the current block.

@since 1.7.0
@param keys The <code>List</code> of keys.
@param values The <code>List</code> of values.
@param jsonGenerator <code>JsonGenerator</code> instance.
@param objectMapper <code>ObjectMapper</code> instance.
@param encoder Instance of <code>StenoEncoder</code>.
@throws IOException If writing JSON fails.
Write specified key - value pairs into the current block .