Fluent Java api for outputting a table of stats
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
LICENSE.txt
NOTICE.txt
README.md
build.gradle
settings.gradle

README.md

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"