An open source library to automatically generate ArrayLists of Plain Old Java Objects for importing, sorting, and filtering data.
- Import CSV files as ArrayLists of Java objects, with support for the Integer, Double, Boolean, String, LocalDate, and LocalDateTime datatypes.
- Autogenerate Comparators and Predicates for sorting and filtering your data via the Stream API.
- Pretty Print ArrayLists in tabular format.
- Write manipulated data out to CSV.
- Support for hosted CSVs
- Add the AutomaticCSV dependancy to your Gradle or Maven Project. (Maven Central)
//Gradle
implementation 'io.github.jbsooter:AutomaticCSV:0.1.4'
- Create a new AutoReadCSV object and read in your file as an ArrayList of the top-level Object class.
AutoReadCSV rCSV = new AutoReadCSV(new URL("https://raw.githubusercontent.com/jbsooter/AutomaticCSV/2121390239d2e3b4e2dd19045cb06d018e53fb83/data/menu.csv"),"Menu.csv");
//AutoReadCSV rCSV = new AutoReadCSV("/path/to/csv"); //Local CSV syntax
ArrayList<Object> csvList = rCSV.readCSV();
Run your program. Now, swap out the top-level Object class for the newly generated class, Menu.
ArrayList<Menu> csvList = rCSV.readCSV();
- Done!