package com.brilliance.isc.swift.objmtconvert.model.mt9xx.tag.tag940;

import com.brilliance.isc.swift.objmtconvert.model.AbsMTCreator;
import com.brilliance.isc.swift.objmtconvert.model.AbsTagCreate;
import com.brilliance.isc.swift.objmtconvert.model.commontag.DcDateCurAmtTagXXX;
import com.brilliance.isc.swift.objmtconvert.model.mt9xx.MT940Creator;

import java.util.LinkedList;
import java.util.List;

public class Tag65Creator extends AbsTagCreate {

     private MT940Creator mt940Creator;

    public Tag65Creator(AbsMTCreator absMTCreator)
    {
        super(absMTCreator);
        this.mt940Creator= (MT940Creator) absMTCreator;
    }

    public void creator()
    {
        List<DcDateCurAmtTagXXX> forwardAvailableBalances = mt940Creator.getForwardAvailableBalance();
        if(forwardAvailableBalances!=null&&forwardAvailableBalances.size()>0){
            for (DcDateCurAmtTagXXX forwardAvailableBalance : forwardAvailableBalances) {
                mt940Creator.set("65", forwardAvailableBalance.getTagResult().getValue());
            }
        }
    }
}
