public TableFormatter content ( Collection < ? > collection ) { this . content . add ( new ArrayList <> ( collection ) ) ; longestCell = ( int ) Math . max ( longestCell , collection . stream ( ) . mapToDouble ( o -> { if ( o instanceof Number ) { return Math . max ( MIN_CELL_WIDTH , length ( Cast . as ( o ) ) ) ; } else { return Math . max ( MIN_CELL_WIDTH , o . toString ( ) . length ( ) + 2 ) ; } } ) . max ( ) . orElse ( 0 ) ) ; longestRow = Math . max ( longestRow , collection . size ( ) ) ; return this ; }
Content table formatter .