package com.brilliance.isc.swift.objmtconvert.model.mt4xx.tag.tag412;

import com.brilliance.isc.swift.objmtconvert.model.AbsMTCreator;
import com.brilliance.isc.swift.objmtconvert.model.AbsTagCreate;
import com.brilliance.isc.swift.objmtconvert.model.mt4xx.MT412Creator;
import com.brilliance.isc.swift.objmtconvert.model.mt4xx.mt4XXAbsCreator.MT412AbsCreator;

import java.util.List;

public class TagCycleCreator extends AbsTagCreate {

     private MT412Creator mt412Creator;

    public TagCycleCreator(AbsMTCreator absMTCreator)
    {
        super(absMTCreator);
        this.mt412Creator= (MT412Creator) absMTCreator;
    }


    public  void creator()
    {
        List<MT412AbsCreator> tagList = mt412Creator.getMt412AbsCreators();
        if(tagList!=null&&tagList.size()>0){
            for (MT412AbsCreator abs412:tagList) {
                mt412Creator.set("20",abs412.getSendingBankTRN());
                mt412Creator.set("21",abs412.getRelatedReference());
                mt412Creator.set("32"+abs412.getDateCurrencyAmount().getTagResult().getTagEnd(),abs412.getDateCurrencyAmount().getTagResult().getValue());
            }
        }
    }
}
