Interface RecordService

    • Method Detail

      • toObject

        <T> T toObject​(Record data,
                       Class<T> expected)
        Simple mapper of record to pojo.
        Type Parameters:
        T - the pojo type (optional).
        data - record to map to pojo.
        expected - : class expected.
        a pojo representing the data record.
      • toRecord

        <T> Record toRecord​(T data)
        Simple mapper of data to record.
        Type Parameters:
        T - the pojo type (optional).
        data - pojo to map to record.
        a record representing the pojo.
      • forwardEntry

        boolean forwardEntry​(Record source,
                             Record.Builder builder,
                             String sourceColumn,
                             Schema.Entry entry)
        Forward an entry from the source record if it exists.
        source - the source record to read data from.
        builder - the current builder to fill.
        sourceColumn - the column name.
        entry - the entry to use for the output column.
        true if the entry was forwarded.
      • toRecord

        Collector<Schema.Entry,​Record.Builder,​RecordtoRecord​(Schema schema,
                                                                           Record fallbackRecord,
                                                                           BiFunction<Schema.Entry,​Record.Builder,​Boolean> customHandler,
                                                                           BiConsumer<Record.Builder,​Boolean> beforeFinish)
        Method providing a collector enabling to create a record from another one in a custom fashion.
        schema - the schema of the record being built.
        fallbackRecord - the source record used when the custom handler does not handle current entry.
        customHandler - a processor of entry enabling to inject custom data in the record being built.
        beforeFinish - a callback before the record is actually built, it enables to add data if not already there.
        a collector enabling to build a record.
      • visit

        <T> T visit​(RecordVisitor<T> visitor,
                    Record record)
        Visit a record with a custom visitor.
        Type Parameters:
        T - the visitor returned type.
        visitor - the visitor to use to browse the record.
        record - record to visit.
        the visitor value.