/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package hu.nir.nmail.spring.beans;

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

/**
 *
 * @author attila
 */
public class NmailInfo {
    private List<String> infoCodeList;
    private List<String> infoMessageList;
    private boolean info;

    public boolean isInfo() {
        if ((infoCodeList != null && infoCodeList.size() > 0) ||
            (infoMessageList != null && infoMessageList.size() > 0)) {
            info = true;
        }
        else {
            info = false;
        }
        
        return info;
    }

    public void setInfo(boolean info) {
        this.info = info;
    }

    public List<String> getInfoCodeList() {
        return infoCodeList;
    }

    public void setInfoCodeList(List<String> infoCodeList) {
        this.infoCodeList = infoCodeList;
    }

    public List<String> getInfoMessageList() {
        return infoMessageList;
    }

    public void setInfoMessageList(List<String> infoMessageList) {
        this.infoMessageList = infoMessageList;
    }
    
    public void addInfoMessage(String infoMessage) {
        if (infoMessageList == null) {
            infoMessageList = new ArrayList<String>();
        }
        infoMessageList.add(infoMessage);
    }
    
    public void addInfoCode(String infoCode) {
        if (infoCodeList == null) {
            infoCodeList = new ArrayList<String>();
        }
        infoCodeList.add(infoCode);
    }
}
