Skip to content

rnnds/sequentia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sequentia Build Status

Sequential data to Java objects

Description

Extracting data

Given raw data:

"John    00000300000015000"

And a mapped bean:

//...
public class Person {

    @SequentialMapping(length = 8)
    private String name;

    @SequentialMapping(length = 7, pad = LEFT, padCharacter = '0')
    private Integer age;

    @SequentialMapping(length = 10, pad = LEFT, padCharacter = '0')
    private Long income;
//...

com.rnnds.sequentia.Extractor will retrieve a populated bean:

Person result = new Extractor().extract(Person.class, "John    00000300000015000")
result.getName(); //John
result.getAge(); //30
result.getIncome(); //15000

Generating data

Given a mapped bean:

//...
public class Person {

    @SequentialMapping(length = 5)
    private String name = "Peter";

    @SequentialMapping(length = 5, pad = LEFT, padCharacter = '0')
    private Integer age;
//...

com.rnnds.sequentia.Generator will retrieve:

new Generator().generate(new Person()); //Peter00050

👍

About

Sequential data to Java objects

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages