All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.zero88.jooqx.adapter.RowConverterStrategy Maven / Gradle / Ivy

package io.zero88.jooqx.adapter;

import java.util.function.Function;
import java.util.stream.Collector;

import org.jooq.Field;

import lombok.NonNull;

/**
 * A row converter strategy collects each row in result set to an expectation result
 *
 * @param  Type of current record
 * @param  Type of output
 */
public interface RowConverterStrategy extends HasStrategy {

    /**
     * Lookup jOOQ field in current jOOQ Query context
     *
     * @param fieldName field name
     * @return jOOQ field, it is nullable
     */
    Field lookupField(@NonNull String fieldName);

    /**
     * Create collector to accumulate each SQL Vert.x row to an expectation output
     *
     * @param getValue a function to collect field value by field
     * @return a collector
     */
    @NonNull Collector, R, I> createCollector(@NonNull Function, Object> getValue);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy