package gcom.gerencial.micromedicao.bean; /** * Classe respons�vel por ajudar o caso de uso [UC0343] Resumo de Anormalidades * * @author Thiago Toscano * @date 20/04/2006 */ public class ResumoAnormalidadeConsumoHelper { private Integer idImovel; private Integer idGerenciaRegional; private Integer idLocalidade; private Integer idSetorComercial; private Integer idRota; private Integer idQuadra; private Integer codigoSetorComercial; private Integer numeroQuadra; private Integer idPerfilImovel; private Integer idSituacaoLigacaoAgua; private Integer idSituacaoLigacaoEsgoto; private Integer idCategoria; private Integer idEsfera; private Integer consumoAnormalidade; private Integer idLigacaoTipo; private int quantidadeImovel = 1; public ResumoAnormalidadeConsumoHelper(){ } public boolean equal(Object obj) { if (obj instanceof ResumoAnormalidadeConsumoHelper) { ResumoAnormalidadeConsumoHelper irleh = (ResumoAnormalidadeConsumoHelper) obj; if (irleh.getIdGerenciaRegional() != null) { // se os atributos forem diferentes if (!irleh.getIdGerenciaRegional().equals(this.getIdGerenciaRegional())) { return false; } // se o atributo no obj for null e nesse objeto for diferente de null, entao retorna falso } else if (this.getIdGerenciaRegional() != null) { return false; } if (irleh.getIdLocalidade() != null) { // se os atributos forem diferentes if (!irleh.getIdLocalidade().equals(this.getIdLocalidade())) { return false; } // se o atributo no obj for null e nesse objeto for diferente de null, entao retorna falso } else if (this.getIdLocalidade() != null) { return false; } if (irleh.getIdSetorComercial() != null) { // se os atributos forem diferentes if (!irleh.getIdSetorComercial().equals(this.getIdSetorComercial())) { return false; } // se o atributo no obj for null e nesse objeto for diferente de null, entao retorna falso } else if (this.getIdSetorComercial() != null) { return false; } if (irleh.getIdRota() != null) { // se os atributos forem diferentes if (!irleh.getIdRota().equals(this.getIdRota())) { return false; } // se o atributo no obj for null e nesse objeto for diferente de null, entao retorna falso } else if (this.getIdRota() != null) { return false; } if (irleh.getIdQuadra() != null) { // se os atributos forem diferentes if (!irleh.getIdQuadra().equals(this.getIdQuadra())) { return false; } // se o atributo no obj for null e nesse objeto for diferente de null, entao retorna falso } else if (this.getIdQuadra() != null) { return false; } if (irleh.getCodigoSetorComercial() != null) { // se os atributos forem diferentes if (!irleh.getCodigoSetorComercial().equals(this.getCodigoSetorComercial())) { return false; } // se o atributo no obj for null e nesse objeto for diferente de null, entao retorna falso } else if (this.getCodigoSetorComercial() != null) { return false; } if (irleh.getNumeroQuadra() != null) { // se os atributos forem diferentes if (!irleh.getNumeroQuadra().equals(this.getNumeroQuadra())) { return false; } // se o atributo no obj for null e nesse objeto for diferente de null, entao retorna falso } else if (this.getNumeroQuadra() != null) { return false; } if (irleh.getIdPerfilImovel() != null) { // se os atributos forem diferentes if (!irleh.getIdPerfilImovel().equals(this.getIdPerfilImovel())) { return false; } // se o atributo no obj for null e nesse objeto for diferente de null, entao retorna falso } else if (this.getIdPerfilImovel() != null) { return false; } if (irleh.getIdSituacaoLigacaoAgua() != null) { // se os atributos forem diferentes if (!irleh.getIdSituacaoLigacaoAgua().equals(this.getIdSituacaoLigacaoAgua())) { return false; } // se o atributo no obj for null e nesse objeto for diferente de null, entao retorna falso } else if (this.getIdSituacaoLigacaoAgua() != null) { return false; } if (irleh.getIdSituacaoLigacaoEsgoto() != null) { // se os atributos forem diferentes if (!irleh.getIdSituacaoLigacaoEsgoto().equals(this.getIdSituacaoLigacaoEsgoto())) { return false; } // se o atributo no obj for null e nesse objeto for diferente de null, entao retorna falso } else if (this.getIdSituacaoLigacaoEsgoto() != null) { return false; } if (irleh.getIdCategoria() != null) { // se os atributos forem diferentes if (!irleh.getIdCategoria().equals(this.getIdCategoria())) { return false; } // se o atributo no obj for null e nesse objeto for diferente de null, entao retorna falso } else if (this.getIdCategoria() != null) { return false; } if (irleh.getIdEsfera() != null) { // se os atributos forem diferentes if (!irleh.getIdEsfera().equals(this.getIdEsfera())) { return false; } // se o atributo no obj for null e nesse objeto for diferente de null, entao retorna falso } else if (this.getIdEsfera() != null) { return false; } if (irleh.getIdLigacaoTipo() != null) { // se os atributos forem diferentes if (!irleh.getIdLigacaoTipo().equals(this.getIdLigacaoTipo())) { return false; } // se o atributo no obj for null e nesse objeto for diferente de null, entao retorna falso } else if (this.getIdLigacaoTipo() != null) { return false; } if (irleh.getConsumoAnormalidade() != null) { // se os atributos forem diferentes if (!irleh.getConsumoAnormalidade().equals(this.consumoAnormalidade)) { return false; } // se o atributo no obj for null e nesse objeto for diferente de null, entao retorna falso } else if (this.getConsumoAnormalidade() != null) { return false; } } else { // se o objeto passado nao for do tipo ImovelResumoLigacaoEconomiaHelper return false; } // todos os parametros sao iguais return true; } public int hashCode() { String retorno = this.getIdImovel() + "sdf" + this.getIdGerenciaRegional() + "sdf" + this.getIdLocalidade() + "sdf" + this.getIdSetorComercial() + "sdf" + this.getIdRota() + "sdf" + this.getIdQuadra() + "sdf" + this.getCodigoSetorComercial() + "sdf" + this.getNumeroQuadra() + "sdf" + this.getIdPerfilImovel() + "sdf" + this.getIdSituacaoLigacaoAgua() + "sdf" + this.getIdSituacaoLigacaoEsgoto() + "sdf" + this.getIdCategoria() + "sdf" + this.getIdEsfera() + "sdf"; if(this.getConsumoAnormalidade() != null){ retorno += this.getConsumoAnormalidade() + "sdf" ; } return retorno.hashCode(); } /** * @return Retorna o campo codigoSetorComercial. */ public Integer getCodigoSetorComercial() { return codigoSetorComercial; } /** * @param codigoSetorComercial O codigoSetorComercial a ser setado. */ public void setCodigoSetorComercial(Integer codigoSetorComercial) { this.codigoSetorComercial = codigoSetorComercial; } /** * @return Retorna o campo idCategoria. */ public Integer getIdCategoria() { return idCategoria; } /** * @param idCategoria O idCategoria a ser setado. */ public void setIdCategoria(Integer idCategoria) { this.idCategoria = idCategoria; } /** * @return Retorna o campo idEsfera. */ public Integer getIdEsfera() { return idEsfera; } /** * @param idEsfera O idEsfera a ser setado. */ public void setIdEsfera(Integer idEsfera) { this.idEsfera = idEsfera; } /** * @return Retorna o campo idGerenciaRegional. */ public Integer getIdGerenciaRegional() { return idGerenciaRegional; } /** * @param idGerenciaRegional O idGerenciaRegional a ser setado. */ public void setIdGerenciaRegional(Integer idGerenciaRegional) { this.idGerenciaRegional = idGerenciaRegional; } /** * @return Retorna o campo idImovel. */ public Integer getIdImovel() { return idImovel; } /** * @param idImovel O idImovel a ser setado. */ public void setIdImovel(Integer idImovel) { this.idImovel = idImovel; } /** * @return Retorna o campo idLocalidade. */ public Integer getIdLocalidade() { return idLocalidade; } /** * @param idLocalidade O idLocalidade a ser setado. */ public void setIdLocalidade(Integer idLocalidade) { this.idLocalidade = idLocalidade; } /** * @return Retorna o campo idPerfilImovel. */ public Integer getIdPerfilImovel() { return idPerfilImovel; } /** * @param idPerfilImovel O idPerfilImovel a ser setado. */ public void setIdPerfilImovel(Integer idPerfilImovel) { this.idPerfilImovel = idPerfilImovel; } /** * @return Retorna o campo idQuadra. */ public Integer getIdQuadra() { return idQuadra; } /** * @param idQuadra O idQuadra a ser setado. */ public void setIdQuadra(Integer idQuadra) { this.idQuadra = idQuadra; } /** * @return Retorna o campo idRota. */ public Integer getIdRota() { return idRota; } /** * @param idRota O idRota a ser setado. */ public void setIdRota(Integer idRota) { this.idRota = idRota; } /** * @return Retorna o campo idSetorComercial. */ public Integer getIdSetorComercial() { return idSetorComercial; } /** * @param idSetorComercial O idSetorComercial a ser setado. */ public void setIdSetorComercial(Integer idSetorComercial) { this.idSetorComercial = idSetorComercial; } /** * @return Retorna o campo idSituacaoLigacaoAgua. */ public Integer getIdSituacaoLigacaoAgua() { return idSituacaoLigacaoAgua; } /** * @param idSituacaoLigacaoAgua O idSituacaoLigacaoAgua a ser setado. */ public void setIdSituacaoLigacaoAgua(Integer idSituacaoLigacaoAgua) { this.idSituacaoLigacaoAgua = idSituacaoLigacaoAgua; } /** * @return Retorna o campo idSituacaoLigacaoEsgoto. */ public Integer getIdSituacaoLigacaoEsgoto() { return idSituacaoLigacaoEsgoto; } /** * @param idSituacaoLigacaoEsgoto O idSituacaoLigacaoEsgoto a ser setado. */ public void setIdSituacaoLigacaoEsgoto(Integer idSituacaoLigacaoEsgoto) { this.idSituacaoLigacaoEsgoto = idSituacaoLigacaoEsgoto; } /** * @return Retorna o campo numeroQuadra. */ public Integer getNumeroQuadra() { return numeroQuadra; } /** * @param numeroQuadra O numeroQuadra a ser setado. */ public void setNumeroQuadra(Integer numeroQuadra) { this.numeroQuadra = numeroQuadra; } /** * @return Retorna o campo quantidadeImovel. */ public int getQuantidadeImovel() { return quantidadeImovel; } /** * @param quantidadeImovel O quantidadeImovel a ser setado. */ public void setQuantidadeImovel(int quantidadeImovel) { this.quantidadeImovel = quantidadeImovel; } public ResumoAnormalidadeConsumoHelper(Integer idImovel, Integer idGerenciaRegional, Integer idLocalidade, Integer idSetorComercial, Integer idRota, Integer idQuadra, Integer codigoSetorComercial, Integer numeroQuadra, Integer idPerfilImovel, Integer idSituacaoLigacaoAgua, Integer idSituacaoLigacaoEsgoto, Integer idEsfera, Integer idConsumoAnormalidade, Integer idLigacaoTipo) { super(); this.idImovel = idImovel; this.idGerenciaRegional = idGerenciaRegional; this.idLocalidade = idLocalidade; this.idSetorComercial = idSetorComercial; this.idRota = idRota; this.idQuadra = idQuadra; this.codigoSetorComercial = codigoSetorComercial; this.numeroQuadra = numeroQuadra; this.idPerfilImovel = idPerfilImovel; this.idSituacaoLigacaoAgua = idSituacaoLigacaoAgua; this.idSituacaoLigacaoEsgoto = idSituacaoLigacaoEsgoto; this.idEsfera = idEsfera; this.consumoAnormalidade = idConsumoAnormalidade; this.idLigacaoTipo = idLigacaoTipo; } public ResumoAnormalidadeConsumoHelper(Integer idImovel, Integer idGerenciaRegional, Integer idLocalidade, Integer idSetorComercial, Integer idRota, Integer idQuadra, Integer codigoSetorComercial, Integer numeroQuadra, Integer idPerfilImovel, Integer idSituacaoLigacaoAgua, Integer idSituacaoLigacaoEsgoto, Integer idEsfera) { super(); this.idImovel = idImovel; this.idGerenciaRegional = idGerenciaRegional; this.idLocalidade = idLocalidade; this.idSetorComercial = idSetorComercial; this.idRota = idRota; this.idQuadra = idQuadra; this.codigoSetorComercial = codigoSetorComercial; this.numeroQuadra = numeroQuadra; this.idPerfilImovel = idPerfilImovel; this.idSituacaoLigacaoAgua = idSituacaoLigacaoAgua; this.idSituacaoLigacaoEsgoto = idSituacaoLigacaoEsgoto; this.idEsfera = idEsfera; } public Integer getConsumoAnormalidade() { return consumoAnormalidade; } public void setConsumoAnormalidade(Integer consumoAnormalidade) { this.consumoAnormalidade = consumoAnormalidade; } public Integer getIdLigacaoTipo() { return idLigacaoTipo; } public void setIdLigacaoTipo(Integer idLigacaoTipo) { this.idLigacaoTipo = idLigacaoTipo; } }