package ru.nbch.credit_tracker.entities.user_response.monitoring_signal_response;

import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlType;

import java.util.ArrayList;
import java.util.List;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
        "subjects"
})
public class Subjects {

    @XmlElement(name = "Subject", required = true)
    protected List<Subject> subjects;

    public List<Subject> getSubjects() {
        if (subjects == null) {
            subjects = new ArrayList<>();
        }
        return this.subjects;
    }


    private Subject currentSubject;

    public void createCurrentSubject() {
        currentSubject = new Subject();
    }

    public Subject getCurrentSubject() {
        return currentSubject;
    }

    public void finalizeSubject() {
        getSubjects().add(currentSubject);
    }
}
