2.4.0
Changes in this release:
This release implements tables!
- Create an object which represents a row:
@HeaderOrder({"First Name", "Age"}) // specifies the sorting of the headers
public static class Person {
@Column("First Name") // must be same as in HeaderOrder
public final String first;
@Column("Age") // must be same as in HeaderOrder
public final int age;
}
- Create table
final Person[] people = new Person[5];
RandomFactory.fill(people); // generate random person objects
// create table and fill with array
final Table table = TableBuilder.from(people, Person.class)
.color(true)
.style(TableStyle.ROUND);
System.out.println(table);
Output
╭────────────┬─────╮
│ First Name │ Age │
├────────────┼─────┤
│ Margaret │ 42 │
│ Michael │ 79 │
│ Anna │ 43 │
│ Cynthia │ 50 │
│ Margaret │ 82 │
╰────────────┴─────╯
Contributors
Installation
Maven
- Add this repository to your
pom.xml
:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
- Add the
eeee
-dependency:
<dependency>
<groupId>com.github.darmiel</groupId>
<artifactId>eeee</artifactId>
<version>2.4.0</version>
</dependency>