/*
 * Created on Aug 10, 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 gov.va.med.fw.model.AbstractKeyedEntity;

import java.math.BigDecimal;

/**
 * @author DNS   TSAIG
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class AacLetterCancelRequest 
	extends AbstractKeyedEntity {

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



	/** The cached hash code value for this instance.  Settting to 0 triggers re-calculation. */
    private int hashValue = 0;



    /** The value of the commsLog association. */
    private BigDecimal commsLogId;

    /**
     * Simple constructor of AbstractCommsPrintRequest instances.
     */
    public AacLetterCancelRequest()
    {
    }

    /**
     * Constructor of AbstractCommsPrintRequest instances given a simple primary key.
     * @param identifier
     */
    public AacLetterCancelRequest(BigDecimal identifier)
    {
        this.setIdentifier(identifier);
    }


    /**
     * Return the value of the COMMS_LOG_IDENTIFIER column.
     * @return CommsLog
     */
    public BigDecimal getCommsLogId()
    {
        return this.commsLogId;
    }

    /**
     * Set the value of the COMMS_LOG_IDENTIFIER column.
     * @param commsLog
     */
    public void setCommsLogId(BigDecimal commsLogId)
    {
        this.commsLogId = commsLogId;
    }
 

    /**
     * Implementation of the equals comparison on the basis of equality of the primary key values.
     * @param rhs
     * @return boolean
     */
    public boolean equals(Object rhs)
    {
        if (rhs == null)
            return false;
        if (! (rhs instanceof AacLetterRequest))
            return false;
        AacLetterCancelRequest that = (AacLetterCancelRequest) rhs;
        if (this.getIdentifier() != null && that.getIdentifier() != null)
        {
            if (! this.getIdentifier().equals(that.getIdentifier()))
            {
                return false;
            }
        }
        return true;
    }

    /**
     * Implementation of the hashCode method conforming to the Bloch pattern with
     * the exception of array properties (these are very unlikely primary key types).
     * @return int
     */
    public int hashCode()
    {
        if (this.hashValue == 0)
        {
            int result = 17;
            int identifierValue = this.getIdentifier() == null ? 0 : this.getIdentifier().hashCode();
            result = result * 37 + identifierValue;
            this.hashValue = result;
        }
        return this.hashValue;
    }
}
