All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.milyn.edi.unedifact.d96a.PAYDUC.SegmentGroup6 Maven / Gradle / Ivy

There is a newer version: 1.7.1.0
Show newest version
/**
 * This class was generated by Smooks EJC (http://www.smooks.org).
 */
package org.milyn.edi.unedifact.d96a.PAYDUC;

import java.io.Serializable;    
import org.milyn.smooks.edi.EDIWritable;    
import org.milyn.edi.unedifact.d96a.common.NameAndAddress;    
import java.util.List;    
import org.milyn.edi.unedifact.d96a.common.Reference;    
import org.milyn.edi.unedifact.d96a.common.MonetaryAmount;    
import org.milyn.edi.unedifact.d96a.common.AdjustmentDetails;    
import org.milyn.edi.unedifact.d96a.common.PaymentTermsBasis;    
import org.milyn.edi.unedifact.d96a.common.FreeText;    
import java.io.Writer;    
import org.milyn.edisax.model.internal.Delimiters;    
import java.io.IOException;    

public class SegmentGroup6 implements Serializable, EDIWritable {

    private static final long serialVersionUID = 1L;

    private NameAndAddress nameAndAddress;
    private List reference;
    private List monetaryAmount;
    private AdjustmentDetails adjustmentDetails;
    private PaymentTermsBasis paymentTermsBasis;
    private List freeText;

    public void write(Writer writer, Delimiters delimiters) throws IOException {
        
        Writer nodeWriter = writer;

        if(nameAndAddress != null) {
            nodeWriter.write("NAD");
            nodeWriter.write(delimiters.getField());
            nameAndAddress.write(nodeWriter, delimiters);
        }
        if(reference != null && !reference.isEmpty()) {
            for(Reference referenceInst : reference) {
                nodeWriter.write("RFF");
                nodeWriter.write(delimiters.getField());
                referenceInst.write(nodeWriter, delimiters);
            }
        }
        if(monetaryAmount != null && !monetaryAmount.isEmpty()) {
            for(MonetaryAmount monetaryAmountInst : monetaryAmount) {
                nodeWriter.write("MOA");
                nodeWriter.write(delimiters.getField());
                monetaryAmountInst.write(nodeWriter, delimiters);
            }
        }
        if(adjustmentDetails != null) {
            nodeWriter.write("AJT");
            nodeWriter.write(delimiters.getField());
            adjustmentDetails.write(nodeWriter, delimiters);
        }
        if(paymentTermsBasis != null) {
            nodeWriter.write("PAT");
            nodeWriter.write(delimiters.getField());
            paymentTermsBasis.write(nodeWriter, delimiters);
        }
        if(freeText != null && !freeText.isEmpty()) {
            for(FreeText freeTextInst : freeText) {
                nodeWriter.write("FTX");
                nodeWriter.write(delimiters.getField());
                freeTextInst.write(nodeWriter, delimiters);
            }
        }
    }

    public NameAndAddress getNameAndAddress() {
        return nameAndAddress;
    }

    public SegmentGroup6 setNameAndAddress(NameAndAddress nameAndAddress) {
        this.nameAndAddress = nameAndAddress;  return this;
    }

    public List getReference() {
        return reference;
    }

    public SegmentGroup6 setReference(List reference) {
        this.reference = reference;  return this;
    }

    public List getMonetaryAmount() {
        return monetaryAmount;
    }

    public SegmentGroup6 setMonetaryAmount(List monetaryAmount) {
        this.monetaryAmount = monetaryAmount;  return this;
    }

    public AdjustmentDetails getAdjustmentDetails() {
        return adjustmentDetails;
    }

    public SegmentGroup6 setAdjustmentDetails(AdjustmentDetails adjustmentDetails) {
        this.adjustmentDetails = adjustmentDetails;  return this;
    }

    public PaymentTermsBasis getPaymentTermsBasis() {
        return paymentTermsBasis;
    }

    public SegmentGroup6 setPaymentTermsBasis(PaymentTermsBasis paymentTermsBasis) {
        this.paymentTermsBasis = paymentTermsBasis;  return this;
    }

    public List getFreeText() {
        return freeText;
    }

    public SegmentGroup6 setFreeText(List freeText) {
        this.freeText = freeText;  return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy