001package org.itsallcode.jdbc.resultset;
002
003import java.sql.ResultSet;
004import java.sql.SQLException;
005
006/**
007 * Converts a single row from a {@link ResultSet} to a generic row type.
008 * 
009 * @param <T> generic row type
010 */
011@FunctionalInterface
012public interface RowMapper<T> {
013    /**
014     * Converts a single row from a {@link ResultSet} to a generic row type.
015     * 
016     * @param resultSet result set
017     * @param rowNum    the current row number (zero based)
018     * @return the converted row
019     * @throws SQLException if accessing the result set fails
020     */
021    T mapRow(ResultSet resultSet, int rowNum) throws SQLException;
022}