org.springframework.yarn.support.console
Class UiUtils

java.lang.Object
  extended by org.springframework.yarn.support.console.UiUtils

public abstract class UiUtils
extends Object

Contains utility methods for rendering data to a formatted console output. E.g. it provides helper methods for rendering ASCII-based data tables.

Author:
Gunnar Hillert, Thomas Risberg, Janne Valkealahti

Field Summary
static int COLUMN_1
           
static int COLUMN_2
           
static int COLUMN_3
           
static int COLUMN_4
           
static int COLUMN_5
           
static int COLUMN_6
           
static String HORIZONTAL_LINE
           
 
Constructor Summary
UiUtils()
           
 
Method Summary
static String getHeaderBorder(Map<Integer,TableHeader> headers)
          Renders the Table header border, based on the map of provided headers.
static String renderMapDataAsTable(List<Map<String,Object>> data, List<String> columns)
          Renders a textual representation of the list of provided Map data
static String renderParameterInfoDataAsTable(Map<String,String> parameters)
          Renders a textual representation of provided parameter map.
static String renderParameterInfoDataAsTable(Map<String,String> parameters, boolean withHeader, int lastColumnMaxWidth)
           
static String renderTextTable(Table table)
           
static String renderTextTable(Table table, boolean withHeader)
          Renders a textual representation of the provided Table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HORIZONTAL_LINE

public static final String HORIZONTAL_LINE
See Also:
Constant Field Values

COLUMN_1

public static final int COLUMN_1
See Also:
Constant Field Values

COLUMN_2

public static final int COLUMN_2
See Also:
Constant Field Values

COLUMN_3

public static final int COLUMN_3
See Also:
Constant Field Values

COLUMN_4

public static final int COLUMN_4
See Also:
Constant Field Values

COLUMN_5

public static final int COLUMN_5
See Also:
Constant Field Values

COLUMN_6

public static final int COLUMN_6
See Also:
Constant Field Values
Constructor Detail

UiUtils

public UiUtils()
Method Detail

renderMapDataAsTable

public static String renderMapDataAsTable(List<Map<String,Object>> data,
                                          List<String> columns)
Renders a textual representation of the list of provided Map data

Parameters:
columns - List of Maps
data - the data
Returns:
The rendered table representation as String

renderParameterInfoDataAsTable

public static String renderParameterInfoDataAsTable(Map<String,String> parameters,
                                                    boolean withHeader,
                                                    int lastColumnMaxWidth)

renderParameterInfoDataAsTable

public static String renderParameterInfoDataAsTable(Map<String,String> parameters)
Renders a textual representation of provided parameter map.

Parameters:
parameters - Map of parameters (key, value)
Returns:
The rendered table representation as String

renderTextTable

public static String renderTextTable(Table table)

renderTextTable

public static String renderTextTable(Table table,
                                     boolean withHeader)
Renders a textual representation of the provided Table

Parameters:
table - Table data Table
withHeader - with header
Returns:
The rendered table representation as String

getHeaderBorder

public static String getHeaderBorder(Map<Integer,TableHeader> headers)
Renders the Table header border, based on the map of provided headers.

Parameters:
headers - Map of headers containing meta information e.g. name+width of header
Returns:
Returns the rendered header border as String