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

import com.brilliance.isc.swift.objmtconvert.model.AbsMTCreator;
import com.brilliance.isc.swift.objmtconvert.model.AbsTagCreate;
import com.brilliance.isc.swift.objmtconvert.model.mt4xx.MT420Creator;
import com.brilliance.isc.swift.objmtconvert.model.mt4xx.mt4XXAbsCreator.MT420AbsCreator;

import java.util.List;

public class TagCycleCreator extends AbsTagCreate {

     private MT420Creator mt420Creator;

    public TagCycleCreator(AbsMTCreator absMTCreator)
    {
        super(absMTCreator);
        this.mt420Creator= (MT420Creator) absMTCreator;
    }


    public  void creator()
    {
        List<MT420AbsCreator> tagList = mt420Creator.getMt420AbsCreators();
        if(tagList!=null&&tagList.size()>0){
            for (MT420AbsCreator abs420:tagList) {
                mt420Creator.set("20",abs420.getSendingBankTRN());
                mt420Creator.set("21",abs420.getRelatedReference());
                mt420Creator.set("32"+abs420.getAmountTraced().getTagResult().getTagEnd(),abs420.getAmountTraced().getTagResult().getValue());
            }
        }
    }
}
