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

org.milyn.edi.unedifact.d05a.common.TCCChargeRateCalculations 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 org.milyn.edi.unedifact.d05a.common.field.C200Charge;    
import org.milyn.edi.unedifact.d05a.common.field.C203RateTariffClass;    
import org.milyn.edi.unedifact.d05a.common.field.C528CommodityRateDetail;    
import org.milyn.edi.unedifact.d05a.common.field.C554RateTariffClassDetail;    
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 TCCChargeRateCalculations implements Serializable, EDIWritable {

    private static final long serialVersionUID = 1L;

    private C200Charge c200Charge;
    private C203RateTariffClass c203RateTariffClass;
    private C528CommodityRateDetail c528CommodityRateDetail;
    private C554RateTariffClassDetail c554RateTariffClassDetail;

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

        List nodeTokens = new ArrayList();

        if(c200Charge != null) {
            c200Charge.write(nodeWriter, delimiters);
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(c203RateTariffClass != null) {
            c203RateTariffClass.write(nodeWriter, delimiters);
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(c528CommodityRateDetail != null) {
            c528CommodityRateDetail.write(nodeWriter, delimiters);
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(c554RateTariffClassDetail != null) {
            c554RateTariffClassDetail.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 C200Charge getC200Charge() {
        return c200Charge;
    }

    public TCCChargeRateCalculations setC200Charge(C200Charge c200Charge) {
        this.c200Charge = c200Charge;  return this;
    }

    public C203RateTariffClass getC203RateTariffClass() {
        return c203RateTariffClass;
    }

    public TCCChargeRateCalculations setC203RateTariffClass(C203RateTariffClass c203RateTariffClass) {
        this.c203RateTariffClass = c203RateTariffClass;  return this;
    }

    public C528CommodityRateDetail getC528CommodityRateDetail() {
        return c528CommodityRateDetail;
    }

    public TCCChargeRateCalculations setC528CommodityRateDetail(C528CommodityRateDetail c528CommodityRateDetail) {
        this.c528CommodityRateDetail = c528CommodityRateDetail;  return this;
    }

    public C554RateTariffClassDetail getC554RateTariffClassDetail() {
        return c554RateTariffClassDetail;
    }

    public TCCChargeRateCalculations setC554RateTariffClassDetail(C554RateTariffClassDetail c554RateTariffClassDetail) {
        this.c554RateTariffClassDetail = c554RateTariffClassDetail;  return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy