package sharin.sql.runner.processor;

import java.sql.ResultSet;

import sharin.sql.runner.ColumnConverter;
import sharin.sql.runner.ResultSetProcessor;

public class ScalarResultSetProcessor implements ResultSetProcessor {

    private final ColumnConverter columnConverter;

    public ScalarResultSetProcessor(ColumnConverter columnConverter) {
        this.columnConverter = columnConverter;
    }

    public Object prepare(ResultSet rs) {
        return null;
    }

    public Object process(ResultSet rs, Object context) {
        return columnConverter.convert(rs, 1);
    }
}
