/*
 * Created on Dec 21, 2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package gov.va.med.esr.common.model.comms;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.GregorianCalendar;
import java.util.Date;
/**
 * @author DNS   TSAIG
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class MailedFileEntry {

	private String formNumber;
	private String caseNumber;
	private String ssn;
	private String nameOnLetter;
	private String line1;
	private String line2;
	private String city;
	private String state;
	private String zip;
	private String mailedDt;
	private String barCode;

	//Form#, Case#, SSN, Name, Line1, Line2, City, State, Zip, Date Mailed, Barcode
	public MailedFileEntry(String formNumber, String caseNumber, String ssn, String nameOnLetter, 
	        String line1, String line2, String city, String state, String zip,
	        String mailedDt, String barCode)
	{
		this.formNumber = formNumber;
		this.caseNumber = caseNumber;
		this.ssn = ssn;
		this.nameOnLetter = nameOnLetter;
		this.line1 = line1;
		this.line2 = line2;
		this.city = city;
		this.state = state;
		this.zip = zip;
		this.mailedDt = mailedDt;
		this.barCode = barCode;

	}
    /**
     * @return Returns the caseNumber.
     */
    public String getCaseNumber() {
        return caseNumber;
    }
    /**
     * @return Returns the formNumber.
     */
    public String getFormNumber() {
        return formNumber;
    }
    /**
     * @return Returns the mailedDate.
     */
    public Date getMailedDate() {
        if (mailedDt != null && mailedDt.length() == 8)
		{
        	try {
            //"MMddyyyy"
        	Date date = new SimpleDateFormat("MMddyyyy").parse(mailedDt);
            
            return date;
        	}
        	catch (ParseException e) {
        		throw new RuntimeException("Invalid date format");
        	}
		}
        
        return null;

    }
    /**
     * @return Returns the nameOnLetter.
     */
    public String getNameOnLetter() {
        return nameOnLetter;
    }
    /**
     * @return Returns the ssn.
     */
    public String getSsn() {
        return ssn;
    }
    /**
     * @return Returns the line2.
     */
    public String getLine2() {
        return line2;
    }
    /**
     * @param line2 The line2 to set.
     */
    public void setLine2(String line2) {
        this.line2 = line2;
    }
    /**
     * @return Returns the city.
     */
    public String getCity() {
        return city;
    }
    /**
     * @return Returns the line1.
     */
    public String getLine1() {
        return line1;
    }
    /**
     * @return Returns the state.
     */
    public String getState() {
        return state;
    }
    /**
     * @return Returns the zip.
     */
    public String getZip() {
        return zip;
    }
    /**
     * @return Returns the barCode.
     */
    public String getBarCode() {
        return barCode;
    }
}
