GithubHelp home page GithubHelp logo

cybortronik / fluent-ssv Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 184 KB

Fluent API to stream CSV, TSV and custom separated files mapped to java beans(to POJOs)

License: MIT License

Java 100.00%

fluent-ssv's Introduction

fluent-ssv (String separated values)

Fluent API to stream CSV, TSV and custom separated values files that are streamed with java beans(to POJOs) Special designed to use streams from Java 8.

To use it add in your pom.xml

<dependency>
  <groupId>com.github.cybortronik</groupId>
  <artifactId>fluent-ssv</artifactId>
  <version>0.1</version>
</dependency>

Example of usage

So you should remember the start point in usage is class named SsvStreamBuilder So simpliest example can be:

class Person {
    private String name;
    private Integer age;

    public get/set....
}

//Some where in usage (default parser is for csv, you can change it see at SsvStreamBuilder methods)
Stream<ParsedRecord<Person>> streamedPersons = new SsvStreamBuilder<Person>()
                                            .forEntity(Person.class)
                                            .stream("~/some/file/path");
...

In this case CSV file will look something like (header by default is matched to Person class set methods), methods order doesn't matter, but you are able to provide custom header and/or line parser, see SsvStreamBuilder:

Name, Age
Victor, 20
Leo, 18
...

ParsedRecord structure

You are able to check if item was parsed with success by calling isParsed() (from class ParsedRecord). Next to get parsed bean call getItem(). To check what happened call getException().

Support

To check more cases ask via github or stackoverflow (put tag fluent-ssv).

fluent-ssv's People

Contributors

cybortronik avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.