package de.fitsample.timerecording;

/**
 * This class makes a {@link TimeRecord TimeRecord}accessible by the
 * {@link TimeRecordingRowFixture TimeRecordingRowFixture}.
 * 
 * @author Ralf
 */
public class TimeRecordRowFixtureAdapter {

    private TimeRecord timeRecord;

    /**
     * Creates a TimeRecordRowFixtureAdapter.
     * 
     * @param timeRecord the TimeRecord it adapts to the RowFixture.
     */
    public TimeRecordRowFixtureAdapter(TimeRecord timeRecord) {
        this.timeRecord = timeRecord;
    }

    /**
     * @return the {@link TimeRecord#getDay() day}of the underlying TimeRecord.
     */
    public int day() {
        return timeRecord.getDay();
    }

    /**
     * @return the {@link TimeFrame#getStartTime() start time}of the underlying
     *         TimeRecord's {@link TimeRecord#getTimeFrame() TimeFrame}.
     */
    public Time from() {
        return timeRecord.getTimeFrame().getStartTime();
    }

    /**
     * @return the {@link TimeFrame#getEndTime() end time}of the underlying
     *         TimeRecord's {@link TimeRecord#getTimeFrame() TimeFrame}.
     */
    public Time to() {
        return timeRecord.getTimeFrame().getEndTime();
    }

}
