41 lines
1.3 KiB
Java
41 lines
1.3 KiB
Java
package com.rjconsultores.ventaboletos.blocos.itau;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import com.rjconsultores.ventaboletos.ArquivoRemessaItem;
|
|
import com.rjconsultores.ventaboletos.blocos.CabecalhoRemessa;
|
|
import com.rjconsultores.ventaboletos.blocos.DetalheObrigatorio;
|
|
import com.rjconsultores.ventaboletos.blocos.RodapeRemessa;
|
|
import com.rjconsultores.ventaboletos.blocos.RodapeRemessaPadrao;
|
|
|
|
public class ArquivoRemessaItau extends ArquivoRemessaItem {
|
|
|
|
@Override
|
|
public void setCabecalhoRemessa(CabecalhoRemessa cabecalhoRemessa) {
|
|
|
|
if(cabecalhoRemessa instanceof CabecalhoRemessaItau){
|
|
super.setCabecalhoRemessa(cabecalhoRemessa);
|
|
}else{
|
|
throw new ClassCastException("Somente cabecalho tipo: " + CabecalhoRemessaItau.class.getName());
|
|
}
|
|
}
|
|
|
|
public void addTitulo(DetalheObrigatorio titulo){
|
|
if(this.titulos == null){
|
|
this.titulos = new ArrayList<DetalheObrigatorio>();
|
|
}
|
|
|
|
if(titulo instanceof DetalheObrigatorioItau){
|
|
this.titulos.add(titulo);
|
|
}else{
|
|
throw new ClassCastException("Somente cabecalho tipo: " + DetalheObrigatorioItau.class.getName());
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public RodapeRemessa getRodapeRemessa() {
|
|
this.rodapeRemessa = this.rodapeRemessa == null ? new RodapeRemessaPadrao() : this.rodapeRemessa;
|
|
return rodapeRemessa;
|
|
}
|
|
}
|