package com.ssj.service.sys.homework.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class HomeworkExerciseUnitDto implements Serializable {
    private static final long serialVersionUID = 1L;

    private String unitId;

    private String unitName;

    private List<HomeworkExercisePeriodDto> periods;

    public HomeworkExerciseUnitDto (String unitId, String unitName){
        this.unitId = unitId;
        this.unitName = unitName;
    }

    public String getUnitId() {
        return unitId;
    }

    public void setUnitId(String unitId) {
        this.unitId = unitId;
    }

    public String getUnitName() {
        return unitName;
    }

    public void setUnitName(String unitName) {
        this.unitName = unitName;
    }

    public List<HomeworkExercisePeriodDto> getPeriods() {
        return periods;
    }

    public void setPeriods(List<HomeworkExercisePeriodDto> periods) {
        this.periods = periods;
    }

    public void addPeriod (HomeworkExercisePeriodDto period){
        if (this.periods == null){
            this.periods = new ArrayList<>();
        }
        this.periods.add(period);
    }
}
