/TableWriter

Fluent Java api for outputting a table of stats

Primary LanguageJavaApache License 2.0Apache-2.0

Table Logger

Fluent api for outputting a table of stats

new TableWriter(table -> System.out.println(table))
            .withColumn("Name").withColumn("Role").withColumn("Working Days")
        .withRows(DONT_ENFORCE_ROW_LENGTHS)
            .row("Tom", "Developer", "5")
            .row("Paul", "Tester", "4")
            .row("Karen", "Support")
        .printTable();

Output:

+-------+-----------+--------------+
| Name  | Role      | Working Days |
+-------+-----------+--------------+
| Tom   | Developer | 5            |
| Paul  | Tester    | 4            |
| Karen | Support   |              |
+-------+-----------+--------------+

The implementation of the interface OutputStrategy allows you to choose how this table gets outputted. The example here simply prints it to std out.

How do I get it?

Maven

<dependency>
    <groupId>io.github.tjheslin1</groupId>
    <artifactId>TableWriter</artifactId>
    <version>1.3</version>
</dependency>

Gradle

compile 'io.github.tjheslin1:TableWriter:1.3'

SBT

libraryDependencies += "io.github.tjheslin1" % "TableWriter" % "1.3"