public static void writeStrings ( String fieldName , List < String > data , JsonGenerator gen ) throws IOException { if ( ! data . isEmpty ( ) ) { gen . writeArrayFieldStart ( fieldName ) ; for ( String d : data ) { gen . writeString ( d ) ; } gen . writeEndArray ( ) ; } }
Writes a string array if not empty .