package org.academiadecodigo.enuminatti.helloworldspringmvc.models;

import org.academiadecodigo.enuminatti.helloworldspringmvc.utils.DateUtils;

import java.util.Date;

/**
 * MIT License
 * (c) 2017 Ricardo Constantino
 */

public class Bootcamp {
    private Integer id;
    private String location;
    private Date start;
    private Date end;

    public Bootcamp() {
    }

    public Bootcamp(Integer id, String location, Date start, Date end) {
        this.id = id;
        this.location = location;
        this.start = start;
        this.end = end;
    }

    public Bootcamp(Integer id, String location, String start, String end) {
        this.id = id;
        this.location = location;
        this.start = DateUtils.parse(start);
        this.end = DateUtils.parse(end);
    }


    public Integer getId() {
        return id;
    }

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

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public Date getStart() {
        return start;
    }

    public String getStartString() {
        return DateUtils.format(start);
    }

    public void setStart(Date start) {
        this.start = start;
    }

    public void setStart(String start) {
        this.start = DateUtils.parse(start);
    }

    public Date getEnd() {
        return end;
    }

    public String getEndString() {
        return DateUtils.format(end);
    }

    public void setEnd(Date end) {
        this.end = end;
    }

    public void setEnd(String end) {
        this.end = DateUtils.parse(end);
    }
}
