package gov.va.med.esr.common.model.security;

import java.io.Serializable;

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

import gov.va.med.fw.model.AbstractKeyedEntity;

public class EEServiceUserRequest extends AbstractKeyedEntity {

	private static final long serialVersionUID = 8379733696156520344L;

	private EEServiceRequestLite eeServiceRequestLite;
	private EEServiceUser eeServiceUser;
	
	
	protected void buildToString(ToStringBuilder builder) {
		builder.append("eeServiceRequestLite", this.eeServiceRequestLite);
		builder.append("eeServiceUser", eeServiceUser);
	}


	public EEServiceRequestLite getEeServiceRequestLite() {
		return eeServiceRequestLite;
	}


	public void setEeServiceRequestLite(EEServiceRequestLite eeServiceRequestLite) {
		this.eeServiceRequestLite = eeServiceRequestLite;
	}


	public EEServiceUser getEeServiceUser() {
		return eeServiceUser;
	}


	public void setEeServiceUser(EEServiceUser eeServiceUser) {
		this.eeServiceUser = eeServiceUser;
	}
	
    public void setIdentifier(Serializable identifier) {
        super.setIdentifier(identifier);
    }

    public Serializable getIdentifier() {
        return super.getIdentifier();
    }
    
	public boolean equals(Object o) {
		   if ( o != null  && o instanceof EEServiceUserRequest) {
			   EEServiceUserRequest eeServiceUserRequest = (EEServiceUserRequest)o;
			   
			   String thisIdValue = this.eeServiceRequestLite.getEntityKey().getKeyValueAsString();

			   String inIdValue = eeServiceUserRequest.getEeServiceRequestLite().getEntityKey().getKeyValueAsString();
			   
			  boolean equalsTest =thisIdValue.equals(inIdValue);
			   return equalsTest;
		   }
		   return false;
		}
		
		public int hashCode() {
			if ( eeServiceRequestLite != null)
			return eeServiceRequestLite.getIdentifier().hashCode();
			
			return 0;
		}
}
