Skip to content

wiku/csv-mapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

csv-mapper

Object to CSV mapping library

Simple adapter library for jackson-dataformat-csv is, which provides a simplified way of mapping CSV lines to/from POJOs and additional utility methods for reading whole CSV files as streams.

Usage

  1. Create Csv mapper instance for a given class using builder:
Csv<User> csv = Csv.from(User.class).build();
  1. Map a simple POJO to CSV:
User user = new User("John", "Smith");
String csvLine = csv.mapToCsv(user);
  1. Map from CSV to POJO:
User user = csv.mapToObject("Steven,Hawking\n");
  1. Read CSV file as Java Stream of POJOs. Eg. print all user names:
csv.readFileAsStream("users.csv")
    .map(User::getName).forEach(System.out::println);

About

Object to CSV mapping utilities for easy hadling of CSV files in Java.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages