Class MarkdownUtils
- java.lang.Object
-
- com.epam.reportportal.utils.formatting.MarkdownUtils
-
public class MarkdownUtils extends java.lang.ObjectSet helpful of utility methods for reporting to ReportPortal
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringLOGICAL_SEPARATORstatic java.lang.StringMARKDOWN_MODEstatic intMAX_TABLE_SIZEstatic intMIN_COL_SIZEstatic java.lang.StringONE_SPACEstatic intPADDING_SPACES_NUMstatic java.lang.StringTABLE_COLUMN_SEPARATORstatic java.lang.StringTABLE_INDENTstatic java.lang.StringTABLE_ROW_SEPARATORstatic java.lang.StringTRUNCATION_REPLACEMENT
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringasCode(java.lang.String language, java.lang.String script)Builds markdown representation of some script to be logged to ReportPortalstatic java.lang.StringasMarkdown(java.lang.String message)Adds special prefix to make log message being processed as markdownstatic java.lang.StringasTwoParts(java.lang.String firstPart, java.lang.String secondPart)static java.lang.StringformatDataTable(java.util.List<java.util.List<java.lang.String>> table)Converts a table represented as List of Lists to a formatted table string.static java.lang.StringformatDataTable(java.util.List<java.util.List<java.lang.String>> table, int maxTableSize)Converts a table represented as List of Lists to a formatted table string.static java.lang.StringformatDataTable(java.util.Map<java.lang.String,java.lang.String> table)Converts a table represented as Map to a formatted table string.
-
-
-
Field Detail
-
MARKDOWN_MODE
public static final java.lang.String MARKDOWN_MODE
- See Also:
- Constant Field Values
-
ONE_SPACE
public static final java.lang.String ONE_SPACE
- See Also:
- Constant Field Values
-
TABLE_INDENT
public static final java.lang.String TABLE_INDENT
- See Also:
- Constant Field Values
-
TABLE_COLUMN_SEPARATOR
public static final java.lang.String TABLE_COLUMN_SEPARATOR
- See Also:
- Constant Field Values
-
TABLE_ROW_SEPARATOR
public static final java.lang.String TABLE_ROW_SEPARATOR
- See Also:
- Constant Field Values
-
TRUNCATION_REPLACEMENT
public static final java.lang.String TRUNCATION_REPLACEMENT
- See Also:
- Constant Field Values
-
PADDING_SPACES_NUM
public static final int PADDING_SPACES_NUM
- See Also:
- Constant Field Values
-
MAX_TABLE_SIZE
public static final int MAX_TABLE_SIZE
- See Also:
- Constant Field Values
-
MIN_COL_SIZE
public static final int MIN_COL_SIZE
- See Also:
- Constant Field Values
-
LOGICAL_SEPARATOR
public static final java.lang.String LOGICAL_SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
asMarkdown
@Nonnull public static java.lang.String asMarkdown(@Nonnull java.lang.String message)Adds special prefix to make log message being processed as markdown- Parameters:
message- Message- Returns:
- Message with markdown marker
-
asCode
@Nonnull public static java.lang.String asCode(@Nullable java.lang.String language, @Nullable java.lang.String script)Builds markdown representation of some script to be logged to ReportPortal- Parameters:
language- Script languagescript- Script- Returns:
- Message to be sent to ReportPortal
-
formatDataTable
@Nonnull public static java.lang.String formatDataTable(@Nonnull java.util.List<java.util.List<java.lang.String>> table, int maxTableSize)Converts a table represented as List of Lists to a formatted table string.- Parameters:
table- a table objectmaxTableSize- maximum size in characters of result table, cells will be truncated- Returns:
- string representation of the table
-
formatDataTable
@Nonnull public static java.lang.String formatDataTable(@Nonnull java.util.List<java.util.List<java.lang.String>> table)Converts a table represented as List of Lists to a formatted table string.- Parameters:
table- a table object- Returns:
- string representation of the table
-
formatDataTable
@Nonnull public static java.lang.String formatDataTable(@Nonnull java.util.Map<java.lang.String,java.lang.String> table)Converts a table represented as Map to a formatted table string.- Parameters:
table- a table object- Returns:
- string representation of the table
-
asTwoParts
@Nonnull public static java.lang.String asTwoParts(@Nonnull java.lang.String firstPart, @Nonnull java.lang.String secondPart)
-
-