/*
 * MailsData.java
 * 
 * Created on 2007.10.18., 22:38:29
 * 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package hu.nir.nmail.spring.beans;

import hu.nir.nmail.utils.NmailUtility;
import java.util.List;
import javax.mail.Message;

/**
 *
 * @author attila
 */
public class MailsData {
    private int messageCount;
    private String senderName;
    private String senderAddress;
    private String testAddresses;
    private int messageIndex;
    private String subject;
    private List<Message> messages;
    
    public MailsData() {
        messageCount = 0;
        messageIndex = 0;
    }
    
    public MailsData(int messageCount, String senderName, String senderAddress, String testAddresses, int messageIndex, String subject) { 
        this.messageCount = messageCount;
        this.senderName = senderName;
        this.senderAddress = senderAddress;
        this.messageIndex = messageIndex;
        this.testAddresses = testAddresses;
        this.subject = subject;
    }

    public List<Message> getMessages() {
        return messages;
    }

    public void setMessages(List<Message> messages) {
        this.messages = messages;
    }

    public int getMessageCount() {
        return messageCount;
    }

    public void setMessageCount(int messageCount) {
        this.messageCount = messageCount;
    }

    public String getSenderName() {
        return senderName;
    }

    public void setSenderName(String senderName) {
        this.senderName = senderName;
    }

    public String getSenderAddress() {
        return senderAddress;
    }

    public void setSenderAddress(String senderAddress) {
        this.senderAddress = senderAddress;
    }

    public String getTestAddresses() {
        return testAddresses;
    }

    public void setTestAddresses(String testAddresses) {
        this.testAddresses = testAddresses;
    }

    public int getMessageIndex() {
        return messageIndex;
    }

    public void setMessageIndex(int messageIndex) {
        this.messageIndex = messageIndex;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }
    
    @Override
    public String toString() {
        return MailsData.class.getName()+"("+
                "messageCount: "+this.messageCount+
                " messageIndex: "+this.messageIndex+
                " senderName: "+this.senderName+
                " senderAddress: "+this.senderAddress+
                " testAddresses: "+this.testAddresses+
                " messages: "+this.messages+")";
    }
    
    public String getEncodedSubject() {
        return NmailUtility.encodeText(subject);
    }
    
    public String getEncodedSenderName() {
        return NmailUtility.encodeText(senderName);
    }
}
