Skip to content
This repository was archived by the owner on Jan 22, 2019. It is now read-only.

Add methods for appending columns of a CsvSchema into another #142

@sharpau

Description

@sharpau

Currently if I am building a CsvSchema with columns from a POJO and some other custom columns, I have to first build a CsvSchema from the POJO, and then provide the columns from that schema to a second CsvSchema.Builder. It's not a huge deal, but it seems like it'd be a nice improvement.

Current situation:

        CsvMapper mapper = new CsvMapper();
        CsvSchema pojoSchema = mapper.schemaFor(Pojo.class);

        CsvSchema fullSchema = CsvSchema.builder()
                .addColumns(pojoSchema)
                .addColumns(otherProperties, CsvSchema.ColumnType.STRING)
                .build().withHeader().withNullValue("");

Desired situation:

        CsvMapper mapper = new CsvMapper();

        CsvSchema fullSchema = CsvSchema.builder()
                .addColumnsFromPojo(Pojo.class)
                .addColumns(otherProperties, CsvSchema.ColumnType.STRING)
                .build().withHeader().withNullValue("");

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions