package com.github.pozo.lastfm.db;

import com.github.pozo.lastfm.core.ArtistBio;
import org.skife.jdbi.v2.StatementContext;
import org.skife.jdbi.v2.tweak.ResultSetMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Created by pozo on 2015.10.06..
 */
public class ArtistBioMapper implements ResultSetMapper<ArtistBio> {
    public static final String NAME = "name";
    public static final String SUMMARY = "summary";

    @Override
    public ArtistBio map(int index, ResultSet rs, StatementContext ctx) throws SQLException {
        return new ArtistBio(rs.getString(NAME), rs.getString(SUMMARY));
    }
}
