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

org.milyn.edi.unedifact.d05a.common.GIDGoodsItemDetails 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.d05a.common;

import java.io.Serializable;    
import org.milyn.smooks.edi.EDIWritable;    
import java.math.BigDecimal;    
import org.milyn.javabean.decoders.DABigDecimalDecoder;    
import org.milyn.edi.unedifact.d05a.common.field.C2131NumberAndTypeOfPackages;    
import java.io.Writer;    
import org.milyn.edisax.model.internal.Delimiters;    
import java.io.IOException;    
import java.io.StringWriter;    
import java.util.List;    
import java.util.ArrayList;    
import org.milyn.edisax.util.EDIUtils;    
import org.milyn.edisax.model.internal.DelimiterType;    

public class GIDGoodsItemDetails implements Serializable, EDIWritable {

    private static final long serialVersionUID = 1L;

    private BigDecimal e1496GoodsItemNumber;
    private DABigDecimalDecoder e1496GoodsItemNumberEncoder;
    private C2131NumberAndTypeOfPackages c2131NumberAndTypeOfPackages;
    private C2131NumberAndTypeOfPackages c2132NumberAndTypeOfPackages;
    private C2131NumberAndTypeOfPackages c2133NumberAndTypeOfPackages;
    private C2131NumberAndTypeOfPackages c2134NumberAndTypeOfPackages;
    private C2131NumberAndTypeOfPackages c2135NumberAndTypeOfPackages;

    public GIDGoodsItemDetails() {
        
        e1496GoodsItemNumberEncoder = new DABigDecimalDecoder();
    }

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

        List nodeTokens = new ArrayList();

        if(e1496GoodsItemNumber != null) {
            nodeWriter.write(delimiters.escape(e1496GoodsItemNumberEncoder.encode(e1496GoodsItemNumber, delimiters)));
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(c2131NumberAndTypeOfPackages != null) {
            c2131NumberAndTypeOfPackages.write(nodeWriter, delimiters);
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(c2132NumberAndTypeOfPackages != null) {
            c2132NumberAndTypeOfPackages.write(nodeWriter, delimiters);
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(c2133NumberAndTypeOfPackages != null) {
            c2133NumberAndTypeOfPackages.write(nodeWriter, delimiters);
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(c2134NumberAndTypeOfPackages != null) {
            c2134NumberAndTypeOfPackages.write(nodeWriter, delimiters);
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(c2135NumberAndTypeOfPackages != null) {
            c2135NumberAndTypeOfPackages.write(nodeWriter, delimiters);
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeTokens.add(nodeWriter.toString());
        writer.write(EDIUtils.concatAndTruncate(nodeTokens, DelimiterType.FIELD, delimiters));
        writer.write(delimiters.getSegmentDelimiter());
        writer.flush();
    }

    public BigDecimal getE1496GoodsItemNumber() {
        return e1496GoodsItemNumber;
    }

    public GIDGoodsItemDetails setE1496GoodsItemNumber(BigDecimal e1496GoodsItemNumber) {
        this.e1496GoodsItemNumber = e1496GoodsItemNumber;  return this;
    }

    public C2131NumberAndTypeOfPackages getC2131NumberAndTypeOfPackages() {
        return c2131NumberAndTypeOfPackages;
    }

    public GIDGoodsItemDetails setC2131NumberAndTypeOfPackages(C2131NumberAndTypeOfPackages c2131NumberAndTypeOfPackages) {
        this.c2131NumberAndTypeOfPackages = c2131NumberAndTypeOfPackages;  return this;
    }

    public C2131NumberAndTypeOfPackages getC2132NumberAndTypeOfPackages() {
        return c2132NumberAndTypeOfPackages;
    }

    public GIDGoodsItemDetails setC2132NumberAndTypeOfPackages(C2131NumberAndTypeOfPackages c2132NumberAndTypeOfPackages) {
        this.c2132NumberAndTypeOfPackages = c2132NumberAndTypeOfPackages;  return this;
    }

    public C2131NumberAndTypeOfPackages getC2133NumberAndTypeOfPackages() {
        return c2133NumberAndTypeOfPackages;
    }

    public GIDGoodsItemDetails setC2133NumberAndTypeOfPackages(C2131NumberAndTypeOfPackages c2133NumberAndTypeOfPackages) {
        this.c2133NumberAndTypeOfPackages = c2133NumberAndTypeOfPackages;  return this;
    }

    public C2131NumberAndTypeOfPackages getC2134NumberAndTypeOfPackages() {
        return c2134NumberAndTypeOfPackages;
    }

    public GIDGoodsItemDetails setC2134NumberAndTypeOfPackages(C2131NumberAndTypeOfPackages c2134NumberAndTypeOfPackages) {
        this.c2134NumberAndTypeOfPackages = c2134NumberAndTypeOfPackages;  return this;
    }

    public C2131NumberAndTypeOfPackages getC2135NumberAndTypeOfPackages() {
        return c2135NumberAndTypeOfPackages;
    }

    public GIDGoodsItemDetails setC2135NumberAndTypeOfPackages(C2131NumberAndTypeOfPackages c2135NumberAndTypeOfPackages) {
        this.c2135NumberAndTypeOfPackages = c2135NumberAndTypeOfPackages;  return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy