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

org.milyn.edi.unedifact.d99b.PRODAT.SegmentGroup21 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.d99b.PRODAT;

import java.io.Serializable;    
import org.milyn.smooks.edi.EDIWritable;    
import org.milyn.edi.unedifact.d99b.common.ComponentDetails;    
import java.util.List;    
import org.milyn.edi.unedifact.d99b.common.Measurements;    
import org.milyn.edi.unedifact.d99b.common.Quantity;    
import org.milyn.edi.unedifact.d99b.common.PercentageDetails;    
import java.io.Writer;    
import org.milyn.edisax.model.internal.Delimiters;    
import java.io.IOException;    

public class SegmentGroup21 implements Serializable, EDIWritable {

    private static final long serialVersionUID = 1L;

    private ComponentDetails componentDetails;
    private List measurements;
    private List quantity;
    private List percentageDetails;

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

        if(componentDetails != null) {
            nodeWriter.write("COD");
            nodeWriter.write(delimiters.getField());
            componentDetails.write(nodeWriter, delimiters);
        }
        if(measurements != null && !measurements.isEmpty()) {
            for(Measurements measurementsInst : measurements) {
                nodeWriter.write("MEA");
                nodeWriter.write(delimiters.getField());
                measurementsInst.write(nodeWriter, delimiters);
            }
        }
        if(quantity != null && !quantity.isEmpty()) {
            for(Quantity quantityInst : quantity) {
                nodeWriter.write("QTY");
                nodeWriter.write(delimiters.getField());
                quantityInst.write(nodeWriter, delimiters);
            }
        }
        if(percentageDetails != null && !percentageDetails.isEmpty()) {
            for(PercentageDetails percentageDetailsInst : percentageDetails) {
                nodeWriter.write("PCD");
                nodeWriter.write(delimiters.getField());
                percentageDetailsInst.write(nodeWriter, delimiters);
            }
        }
    }

    public ComponentDetails getComponentDetails() {
        return componentDetails;
    }

    public SegmentGroup21 setComponentDetails(ComponentDetails componentDetails) {
        this.componentDetails = componentDetails;  return this;
    }

    public List getMeasurements() {
        return measurements;
    }

    public SegmentGroup21 setMeasurements(List measurements) {
        this.measurements = measurements;  return this;
    }

    public List getQuantity() {
        return quantity;
    }

    public SegmentGroup21 setQuantity(List quantity) {
        this.quantity = quantity;  return this;
    }

    public List getPercentageDetails() {
        return percentageDetails;
    }

    public SegmentGroup21 setPercentageDetails(List percentageDetails) {
        this.percentageDetails = percentageDetails;  return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy