Skip to content

2.4.0

Compare
Choose a tag to compare
@darmiel darmiel released this 04 Mar 17:38
· 22 commits to main since this release
3e38563

Changes in this release:

This release implements tables!

  1. 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;
}
  1. 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

  1. Add this repository to your pom.xml:
<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>
  1. Add the eeee-dependency:
<dependency>
    <groupId>com.github.darmiel</groupId>
    <artifactId>eeee</artifactId>
    <version>2.4.0</version>
</dependency>