package com.fitbank.hb.persistence.trans;

import java.io.Serializable;
import java.lang.reflect.Field;

/**Clase que hace referencia a la Clave Primaria de TMAPEOCOMPONENTERUBRO*/
public class TmappercomponetsKey   implements Serializable{
/**
* HashCode asociado con la Instancia
*/
private volatile int hashValue = 0;
/**
* Version de la Clase
*/
private static final long serialVersionUID = 1L;
/**
* Codigo del subsistema
*/
private String csubsistema;

/**
* Codigo de la transaccion
*/
private String ctransaccion;

/**
* Version de la transaccion
*/
private String versiontransaccion;

/**
* Codigo de componente debito credito.
*/
private Integer componente;

/**Contructor por defecto*/
public TmappercomponetsKey(){}
/**Contructor de TmappercomponetsKey
@param pCsubsistema Codigo del subsistema
@param pCtransaccion Codigo de la transaccion
@param pVersiontransaccion Version de la transaccion
@param pComponente Codigo de componente debito credito.
*/
public TmappercomponetsKey(String pCsubsistema,String pCtransaccion,String pVersiontransaccion,Integer pComponente){
 csubsistema=pCsubsistema;
 ctransaccion=pCtransaccion;
 versiontransaccion=pVersiontransaccion;
 componente=pComponente;
}
/**Obtiene el valor de csubsistema
@return valor de csubsistema*/
public String getCsubsistema(){
  return csubsistema;
}
/**Fija el valor de csubsistema
@param pCsubsistema nuevo Valor de csubsistema*/
public void setCsubsistema(String pCsubsistema){
  csubsistema=pCsubsistema;
}

/**Obtiene el valor de ctransaccion
@return valor de ctransaccion*/
public String getCtransaccion(){
  return ctransaccion;
}
/**Fija el valor de ctransaccion
@param pCtransaccion nuevo Valor de ctransaccion*/
public void setCtransaccion(String pCtransaccion){
  ctransaccion=pCtransaccion;
}

/**Obtiene el valor de versiontransaccion
@return valor de versiontransaccion*/
public String getVersiontransaccion(){
  return versiontransaccion;
}
/**Fija el valor de versiontransaccion
@param pVersiontransaccion nuevo Valor de versiontransaccion*/
public void setVersiontransaccion(String pVersiontransaccion){
  versiontransaccion=pVersiontransaccion;
}

/**Obtiene el valor de componente
@return valor de componente*/
public Integer getComponente(){
  return componente;
}
/**Fija el valor de componente
@param pComponente nuevo Valor de componente*/
public void setComponente(Integer pComponente){
  componente=pComponente;
}

/**Implementación de la comparación de TmappercomponetsKey
@param o Objeto de comparación
*/
public boolean equals(Object o){
  if (o == null)return false;
  if (! (o instanceof TmappercomponetsKey))return false;
  TmappercomponetsKey that = (TmappercomponetsKey) o;
  if (this.getCsubsistema() == null || that.getCsubsistema() == null){
      return false;
  }
  if (! this.getCsubsistema().equals(that.getCsubsistema())){
    return false;
  }
  if (this.getCtransaccion() == null || that.getCtransaccion() == null){
      return false;
  }
  if (! this.getCtransaccion().equals(that.getCtransaccion())){
    return false;
  }
  if (this.getVersiontransaccion() == null || that.getVersiontransaccion() == null){
      return false;
  }
  if (! this.getVersiontransaccion().equals(that.getVersiontransaccion())){
    return false;
  }
  if (this.getComponente() == null || that.getComponente() == null){
      return false;
  }
  if (! this.getComponente().equals(that.getComponente())){
    return false;
  }
  return true;
}
/**Implementación del método hashCode bajo el patrón de Bloch
@return hashCode de la instancia TmappercomponetsKey
*/
public int hashCode(){
  if (this.hashValue == 0){
    int result = 17;
    result = result * 37 + (this.getCsubsistema() == null ? 0 : this.getCsubsistema().hashCode());
    result = result * 37 + (this.getCtransaccion() == null ? 0 : this.getCtransaccion().hashCode());
    result = result * 37 + (this.getVersiontransaccion() == null ? 0 : this.getVersiontransaccion().hashCode());
    result = result * 37 + (this.getComponente() == null ? 0 : this.getComponente().hashCode());
    this.hashValue = result;
  }
  return this.hashValue;
}
/**Implementación toString
*/
public String toString() {
	Field[]fs=this.getClass().getDeclaredFields();
	String data="";
	for(Field f:fs){
	 try{	
	 String name=f.getName();
	 if(name.compareTo("hashValue")==0||name.compareTo("serialVersionUID")==0)continue;
		data+="pk."+name+"="+f.get(this)+";";
	 }catch(Exception e){
		 continue;
	 }
		}
		if(data.compareTo("")==0){
		data=super.toString();
		}
	return data;
	}
}
