package gov.va.med.esr.common.batchprocess;

import org.apache.commons.lang.builder.ToStringBuilder;

import gov.va.med.fw.batchprocess.DataQueryProcessStatistics;
import gov.va.med.fw.batchprocess.ProcessStatistics;

/**
 * A class to collect statistics for appointment conversion job 
 * 
 * @author DNS   ruizc
 *
 */
public class AppointmentConversionStatistics extends DataQueryProcessStatistics {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8380644189303710637L;

	private static final String NUMBER_WITH_CANCEL_DECLINE_STATUS= "numberWithCancelledDeclinedStatus";	
	private static final String NUMBER_WITH_REJECTED_ENROLLMENT_STATUS= "numberWithRejectedEnrollmentStatus";	
	
	private int numberWithCancelledDeclinedStatus;	
	
	private int numberWithRejectedEnrollmentStatus;	
	
	protected void appendStats(ProcessStatistics stats) {

		AppointmentConversionStatistics incoming = (AppointmentConversionStatistics) stats;
		this.incrementNumberWithCancelledDeclinedStatus(incoming.getNumberWithCancelledDeclinedStatus());
		this.incrementNumberWithRejectedEnrollmentStatus(incoming.getNumberWithRejectedEnrollmentStatus());
	}

	protected void buildToString(ToStringBuilder builder) {
		super.buildToString(builder);
		
		builder.append(NUMBER_WITH_CANCEL_DECLINE_STATUS, numberWithCancelledDeclinedStatus);
		builder.append(NUMBER_WITH_REJECTED_ENROLLMENT_STATUS, numberWithRejectedEnrollmentStatus);		
	}

	public int getNumberWithCancelledDeclinedStatus() {
		return numberWithCancelledDeclinedStatus;
	}

	public void setNumberWithCancelledDeclinedStatus(
			int numberWithCancelledDeclinedStatus) {
		this.numberWithCancelledDeclinedStatus = numberWithCancelledDeclinedStatus;
	}

	public int getNumberWithRejectedEnrollmentStatus() {
		return numberWithRejectedEnrollmentStatus;
	}

	public void setNumberWithRejectedEnrollmentStatus(
			int numberWithRejectedEnrollmentStatus) {
		this.numberWithRejectedEnrollmentStatus = numberWithRejectedEnrollmentStatus;
	}
	
	public void incrementNumberWithCancelledDeclinedStatus(int count) {
		this.numberWithCancelledDeclinedStatus += count;
	}
	public void incrementNumberWithRejectedEnrollmentStatus(int count) {
		this.numberWithRejectedEnrollmentStatus += count;
	}		
}
