package test05.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Course {
    @NonNull
    private Integer id = -1;
    @NonNull
    private String name = "";
    @NonNull
    private Integer type = -1;
    @NonNull
    private Float credit = -1.0F;
    @NonNull
    private Integer grade = -1;
    @NonNull
    private Integer major = -1;
    @NonNull
    private String detail = "";

    public Course(int id) {
        this.id = id;
    }

    public boolean isComplete() {
        return id != -1 && type != -1 && !name.isEmpty() && grade != -1 && major != -1 && credit != -1;
    }
}
