package de.fitsample.timerecording;

/**
 * Represents one entry in the TimeRecording.
 * 
 * @author Ralf
 */
public class TimeRecord {

    private int day;
    private TimeFrame timeframe;

    /**
     * Creates a TimeRecord.
     * 
     * @param day the day the TimeFrame is associated with. If day < 0 an
     *            IllegalArgumentException is thrown.
     * @param timeframe the TimeFrame to add. If timeframe == null an
     *            IllegalArgumentException is thrown.
     * 
     * @throws IllegalArgumentException
     */
    public TimeRecord(int day, TimeFrame timeframe) {
        if (day < 0) {
            throw new IllegalArgumentException("day must be >= 0");
        }
        if (timeframe == null) {
            throw new IllegalArgumentException("timeframe must not be null");
        }
        this.day = day;
        this.timeframe = timeframe;
    }

    /**
     * @return the day.
     */
    public int getDay() {
        return day;
    }

    /**
     * @return the TimeFrame.
     */
    public TimeFrame getTimeFrame() {
        return timeframe;
    }
}
