package edu.fiu.models;

import org.jdbi.v3.core.mapper.RowMapper;
import org.jdbi.v3.core.statement.StatementContext;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Type for storing activities
 *
 * @author Dariel Barroso
 */
public class Activity {

    protected Integer id;
    protected String name;
    protected String type; //Type of activity
    protected String dataPath; //URL path to the json file
    protected String status; //indicates whether an activity is active or not

    public Activity(Integer id, String name, String type, String dataPath, String status)
    {
        this.id = id;
        this.name = name;
        this.type = type;
        this.dataPath = dataPath;
        this.status = status;
    }

    public static class Mapper implements RowMapper<Activity> {
        @Override
        public Activity map(final ResultSet rs, final StatementContext ctx) throws SQLException {

            return new Activity(rs.getInt("id"), rs.getString("name"), rs.getString("type"), rs.getString("dataPath"), rs.getString("status"));
        }
    }

    public Integer getId()
    {
        return id;
    }

    public void setId(Integer id)
    {
        this.id = id;
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public String getType()
    {
        return type;
    }

    public void setType(String type)
    {
        this.type = type;
    }

    public String getDataPath()
    {
        return dataPath;
    }

    public void setDataPath(String dataPath)
    {
        this.dataPath = dataPath;
    }

    public void setStatus(String status){
        this.status = status; 
    }

    public String getStatus()
    {
        return status; 
    }
}
