POI - ignorar atributos nulos?

0 respostas
P

Opa :smiley:

Existe alguma maneira do POI ignorar atributos que tenham um valor nulo? Eu tenho um relatório muito grande e fica bem ‘porco’ o código ter que fazer muitos ifs para verificar:

if(oferta.getCdGrupoRemarcacao() != null){
				linha.createCell(0).setCellValue(oferta.getCdGrupoRemarcacao()); 
			}
			if(oferta.getCdProduto() != null) {
				linha.createCell(1).setCellValue(oferta.getCdProduto());
			}
			if(oferta.getCdOferta() != null){
				linha.createCell(2).setCellValue(oferta.getCdOferta());
			}

Tem alguma solução para evitar isso?

Criado 27 de outubro de 2008
Respostas 0
Participantes 1