private static String createRowTemplate ( List < Integer > maxColumnSizes ) { List < String > columnFormatSpecifiers = Lists . newArrayList ( ) ; for ( int maxColumnSize : maxColumnSizes ) { columnFormatSpecifiers . add ( "%-" + maxColumnSize + "s" ) ; } return new StringBuilder ( "| " ) . append ( Joiner . on ( " | " ) . join ( columnFormatSpecifiers ) ) . append ( " |\n" ) . toString ( ) ; }
Creates the row template given the maximum size for each column