public static String toNamedString ( Object object , Object ... components ) { StringBuilder b = new StringBuilder ( components . length * 5 + 2 ) ; if ( object != null ) { b . append ( object . getClass ( ) . getSimpleName ( ) ) . append ( ' ' ) ; } b . append ( ' ' ) ; for ( int i = 0 ; i < components . length ; i ++ ) { if ( i != 0 ) { b . append ( ", " ) ; } b . append ( components [ i ] ) ; } b . append ( ' ' ) ; return b . toString ( ) ; }
Wraps all components in between brackets delimited by - signs appending the class name in front of it .