src/test/java/ucar/geoapi/ContentVerifier.java
private static void formatTable(final String label, final Collection<Map.Entry<String,Object>> values,
            final StringBuilder appendTo, final String lineSeparator)
    {
        if (!values.isEmpty()) {
            appendTo.append(label).append(" = {").append(lineSeparator);
            int width = -1;
            for (final Map.Entry<String,Object> entry : values) {
                final int length = entry.getKey().length();
                if (length > width) width = length;
            }
            width++;
            for (final Map.Entry<String,Object> entry : values) {
                final String key = entry.getKey();
                appendTo.append("    \"").append(key).append("\":");
                for (int i = width - key.length(); --i >= 0;) {
                    appendTo.append(' ');
                }
                final Object value = entry.getValue();
                if (value instanceof Mismatch) {
                    ((Mismatch) value).toString(appendTo);
                } else {
                    formatValue(value, appendTo);
                }
                appendTo.append(',').append(lineSeparator);
            }
            if (width > 0) {                                                                // Paranoiac check.
                appendTo.deleteCharAt(appendTo.length() - lineSeparator.length() - 1);      // Remove last comma.
            }
            appendTo.append('}').append(lineSeparator);
        }
    }
/**
     * Formats the given entry as a table in the given {@link StringBuilder}.
     */
Formats the given entry as a table in the given  StringBuilder.
Formats the given entry as a table in the given StringBuilder .
private static void formatTable(final String label, final Collection<Map.Entry<String,Object>> values,
            final StringBuilder appendTo, final String lineSeparator)
    {
        if (!values.isEmpty()) {
            appendTo.append(label).append(" = {").append(lineSeparator);
            int width = -1;
            for (final Map.Entry<String,Object> entry : values) {
                final int length = entry.getKey().length();
                if (length > width) width = length;
            }
            width++;
            for (final Map.Entry<String,Object> entry : values) {
                final String key = entry.getKey();
                appendTo.append("    \"").append(key).append("\":");
                for (int i = width - key.length(); --i >= 0;) {
                    appendTo.append(' ');
                }
                final Object value = entry.getValue();
                if (value instanceof Mismatch) {
                    ((Mismatch) value).toString(appendTo);
                } else {
                    formatValue(value, appendTo);
                }
                appendTo.append(',').append(lineSeparator);
            }
            if (width > 0) {                                                                
                appendTo.deleteCharAt(appendTo.length() - lineSeparator.length() - 1);      
            }
            appendTo.append('}').append(lineSeparator);
        }
    }
private static void formatTable ( final String label , final Collection < Map . Entry < String , Object > > values , final StringBuilder appendTo , final String lineSeparator ) { if ( ! values . isEmpty ( ) ) { appendTo . append ( label ) . append ( " = {" ) . append ( lineSeparator ) ; int width = - 1 ; for ( final Map . Entry < String , Object > entry : values ) { final int length = entry . getKey ( ) . length ( ) ; if ( length > width ) width = length ; } width ++ ; for ( final Map . Entry < String , Object > entry : values ) { final String key = entry . getKey ( ) ; appendTo . append ( "    \"" ) . append ( key ) . append ( "\":" ) ; for ( int i = width - key . length ( ) ; -- i >= 0 ; ) { appendTo . append ( ' ' ) ; } final Object value = entry . getValue ( ) ; if ( value instanceof Mismatch ) { ( ( Mismatch ) value ) . toString ( appendTo ) ; } else { formatValue ( value , appendTo ) ; } appendTo . append ( ',' ) . append ( lineSeparator ) ; } if ( width > 0 ) { appendTo . deleteCharAt ( appendTo . length ( ) - lineSeparator . length ( ) - 1 ) ; } appendTo . append ( '}' ) . append ( lineSeparator ) ; } }
Formats the given entry as a table in the given {@link StringBuilder}.
Formats the given entry as a table in the given { @link StringBuilder } .
// Paranoiac check. // Remove last comma.