package de.avatic.taricdb.model;

import java.util.HashSet;
import java.util.Set;

import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.MappedCollection;

import jakarta.validation.constraints.Size;

public class ConditionType {

	@Id
    private Integer id;
    
    @Size(max = 2)
    private String conditionTypeCode;
    
    @MappedCollection(idColumn = "ref_id")
    private Set<ConditionTypeDesc> conditionTypeDesc;

    public ConditionType(String conditionTypeCode) {
		this.conditionTypeCode = conditionTypeCode;
		this.conditionTypeDesc = new HashSet<>();
	}

	public Integer getId() {
        return id;
    }

    public void setId(final Integer id) {
        this.id = id;
    }

    public String getConditionTypeCode() {
        return conditionTypeCode;
    }

    public void setConditionTypeCode(final String conditionTypeCode) {
        this.conditionTypeCode = conditionTypeCode;
    }
    
    public void addConditionTypeDesc(ConditionTypeDesc conditionTypeDesc) {
    	        this.conditionTypeDesc.add(conditionTypeDesc);
    }

}
