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

org.milyn.edi.unedifact.d06b.DESADV.SegmentGroup19 Maven / Gradle / Ivy

/**
 * This class was generated by Smooks EJC (http://www.smooks.org).
 */
package org.milyn.edi.unedifact.d06b.DESADV;

import java.io.Serializable;    
import org.milyn.smooks.edi.EDIWritable;    
import org.milyn.edi.unedifact.d06b.common.DangerousGoods;    
import org.milyn.edi.unedifact.d06b.common.Quantity;    
import java.util.List;    
import org.milyn.edi.unedifact.d06b.common.FreeText;    
import java.io.Writer;    
import org.milyn.edisax.model.internal.Delimiters;    
import java.io.IOException;    

public class SegmentGroup19 implements Serializable, EDIWritable {

    private static final long serialVersionUID = 1L;

    private DangerousGoods dangerousGoods;
    private Quantity quantity;
    private List freeText;

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

        if(dangerousGoods != null) {
            nodeWriter.write("DGS");
            nodeWriter.write(delimiters.getField());
            dangerousGoods.write(nodeWriter, delimiters);
        }
        if(quantity != null) {
            nodeWriter.write("QTY");
            nodeWriter.write(delimiters.getField());
            quantity.write(nodeWriter, delimiters);
        }
        if(freeText != null && !freeText.isEmpty()) {
            for(FreeText freeTextInst : freeText) {
                nodeWriter.write("FTX");
                nodeWriter.write(delimiters.getField());
                freeTextInst.write(nodeWriter, delimiters);
            }
        }
    }

    public DangerousGoods getDangerousGoods() {
        return dangerousGoods;
    }

    public SegmentGroup19 setDangerousGoods(DangerousGoods dangerousGoods) {
        this.dangerousGoods = dangerousGoods;  return this;
    }

    public Quantity getQuantity() {
        return quantity;
    }

    public SegmentGroup19 setQuantity(Quantity quantity) {
        this.quantity = quantity;  return this;
    }

    public List getFreeText() {
        return freeText;
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy