/**
 * 
 */


package gov.va.med.cds.common.person.correlation;


/**
 * @author DNS   ecclej
 * @generated "UML to Java V5.0 (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)"
 */
public class PersonIdentifier
    implements
        PersonIdentifierInterface
{
    /**
     * @generated "UML to Java V5.0 (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)"
     */
    public String identity;


    /**
     * @return the identity
     * @generated "UML to Java V5.0 (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)"
     */
    public String getIdentity( )
    {
        // begin-user-code
        return identity;
        // end-user-code
    }


    /**
     * @param theIdentity the identity to set
     * @generated "UML to Java V5.0 (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)"
     */
    public void setIdentity( String theIdentity )
    {
        // begin-user-code
        identity = theIdentity;
        // end-user-code
    }

    /**
     * @generated "UML to Java V5.0 (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)"
     */
    public String assigningFacility;


    /**
     * @return the assigningFacility
     * @generated "UML to Java V5.0 (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)"
     */
    public String getAssigningFacility( )
    {
        // begin-user-code
        return assigningFacility;
        // end-user-code
    }


    /**
     * @param theAssigningFacility the assigningFacility to set
     * @generated "UML to Java V5.0 (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)"
     */
    public void setAssigningFacility( String theAssigningFacility )
    {
        // begin-user-code
        assigningFacility = theAssigningFacility;
        // end-user-code
    }

    /**
     * @generated "UML to Java V5.0 (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)"
     */
    public String assigningAuthority;


    /**
     * @return the assigningAuthority
     * @generated "UML to Java V5.0 (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)"
     */
    public String getAssigningAuthority( )
    {
        // begin-user-code
        return assigningAuthority;
        // end-user-code
    }


    /**
     * @param theAssigningAuthority the assigningAuthority to set
     * @generated "UML to Java V5.0 (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)"
     */
    public void setAssigningAuthority( String theAssigningAuthority )
    {
        // begin-user-code
        assigningAuthority = theAssigningAuthority;
        // end-user-code
    }
    
 
    @Override
    public boolean equals(Object obj) {
    	
    	if( obj == null || !(obj instanceof PersonIdentifier) )
    	{
    		return false;
    	}
    	
    	PersonIdentifier personIdentifier = (PersonIdentifier)obj;
    	return (((this.assigningAuthority == null && personIdentifier.assigningAuthority == null) || 
    					this.assigningAuthority.equals(personIdentifier.assigningAuthority)) &&
    			((this.assigningFacility == null && personIdentifier.assigningFacility == null ) || (
    					this.assigningFacility.equals(personIdentifier.assigningFacility))) && 
    			((this.identity == null && personIdentifier.identity == null) || ( 
    					this.identity.equals(personIdentifier.identity)))); 
    }
    
 
    @Override
    public int hashCode() {
    	return (this.assigningAuthority + this.assigningFacility + this.identity).hashCode();
    }
}
