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

org.milyn.edi.unedifact.d06b.common.DangerousGoods Maven / Gradle / Ivy

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

import java.io.Serializable;    
import org.milyn.smooks.edi.EDIWritable;    
import org.milyn.edi.unedifact.d06b.common.field.HazardCodeC205;    
import org.milyn.edi.unedifact.d06b.common.field.UndgInformationC234;    
import org.milyn.edi.unedifact.d06b.common.field.DangerousGoodsShipmentFlashpointC223;    
import org.milyn.edi.unedifact.d06b.common.field.HazardIdentificationPlacardDetailsC235;    
import org.milyn.edi.unedifact.d06b.common.field.DangerousGoodsLabelC236;    
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 DangerousGoods implements Serializable, EDIWritable {

    private static final long serialVersionUID = 1L;

    private String dangerousGoodsRegulationsCode;
    private HazardCodeC205 hazardCode;
    private UndgInformationC234 undgInformation;
    private DangerousGoodsShipmentFlashpointC223 dangerousGoodsShipmentFlashpoint;
    private String packagingDangerLevelCode;
    private String emergencyProcedureForShipsIdentifier;
    private String hazardMedicalFirstAidGuideIdentifier;
    private String transportEmergencyCardIdentifier;
    private HazardIdentificationPlacardDetailsC235 hazardIdentificationPlacardDetails;
    private DangerousGoodsLabelC236 dangerousGoodsLabel;
    private String packingInstructionTypeCode;
    private String transportMeansDescriptionCode;
    private String hazardousCargoTransportAuthorisationCode;

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

        List nodeTokens = new ArrayList();

        if(dangerousGoodsRegulationsCode != null) {
            nodeWriter.write(delimiters.escape(dangerousGoodsRegulationsCode.toString()));
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(hazardCode != null) {
            hazardCode.write(nodeWriter, delimiters);
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(undgInformation != null) {
            undgInformation.write(nodeWriter, delimiters);
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(dangerousGoodsShipmentFlashpoint != null) {
            dangerousGoodsShipmentFlashpoint.write(nodeWriter, delimiters);
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(packagingDangerLevelCode != null) {
            nodeWriter.write(delimiters.escape(packagingDangerLevelCode.toString()));
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(emergencyProcedureForShipsIdentifier != null) {
            nodeWriter.write(delimiters.escape(emergencyProcedureForShipsIdentifier.toString()));
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(hazardMedicalFirstAidGuideIdentifier != null) {
            nodeWriter.write(delimiters.escape(hazardMedicalFirstAidGuideIdentifier.toString()));
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(transportEmergencyCardIdentifier != null) {
            nodeWriter.write(delimiters.escape(transportEmergencyCardIdentifier.toString()));
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(hazardIdentificationPlacardDetails != null) {
            hazardIdentificationPlacardDetails.write(nodeWriter, delimiters);
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(dangerousGoodsLabel != null) {
            dangerousGoodsLabel.write(nodeWriter, delimiters);
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(packingInstructionTypeCode != null) {
            nodeWriter.write(delimiters.escape(packingInstructionTypeCode.toString()));
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(transportMeansDescriptionCode != null) {
            nodeWriter.write(delimiters.escape(transportMeansDescriptionCode.toString()));
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(hazardousCargoTransportAuthorisationCode != null) {
            nodeWriter.write(delimiters.escape(hazardousCargoTransportAuthorisationCode.toString()));
            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 String getDangerousGoodsRegulationsCode() {
        return dangerousGoodsRegulationsCode;
    }

    public DangerousGoods setDangerousGoodsRegulationsCode(String dangerousGoodsRegulationsCode) {
        this.dangerousGoodsRegulationsCode = dangerousGoodsRegulationsCode;  return this;
    }

    public HazardCodeC205 getHazardCode() {
        return hazardCode;
    }

    public DangerousGoods setHazardCode(HazardCodeC205 hazardCode) {
        this.hazardCode = hazardCode;  return this;
    }

    public UndgInformationC234 getUndgInformation() {
        return undgInformation;
    }

    public DangerousGoods setUndgInformation(UndgInformationC234 undgInformation) {
        this.undgInformation = undgInformation;  return this;
    }

    public DangerousGoodsShipmentFlashpointC223 getDangerousGoodsShipmentFlashpoint() {
        return dangerousGoodsShipmentFlashpoint;
    }

    public DangerousGoods setDangerousGoodsShipmentFlashpoint(DangerousGoodsShipmentFlashpointC223 dangerousGoodsShipmentFlashpoint) {
        this.dangerousGoodsShipmentFlashpoint = dangerousGoodsShipmentFlashpoint;  return this;
    }

    public String getPackagingDangerLevelCode() {
        return packagingDangerLevelCode;
    }

    public DangerousGoods setPackagingDangerLevelCode(String packagingDangerLevelCode) {
        this.packagingDangerLevelCode = packagingDangerLevelCode;  return this;
    }

    public String getEmergencyProcedureForShipsIdentifier() {
        return emergencyProcedureForShipsIdentifier;
    }

    public DangerousGoods setEmergencyProcedureForShipsIdentifier(String emergencyProcedureForShipsIdentifier) {
        this.emergencyProcedureForShipsIdentifier = emergencyProcedureForShipsIdentifier;  return this;
    }

    public String getHazardMedicalFirstAidGuideIdentifier() {
        return hazardMedicalFirstAidGuideIdentifier;
    }

    public DangerousGoods setHazardMedicalFirstAidGuideIdentifier(String hazardMedicalFirstAidGuideIdentifier) {
        this.hazardMedicalFirstAidGuideIdentifier = hazardMedicalFirstAidGuideIdentifier;  return this;
    }

    public String getTransportEmergencyCardIdentifier() {
        return transportEmergencyCardIdentifier;
    }

    public DangerousGoods setTransportEmergencyCardIdentifier(String transportEmergencyCardIdentifier) {
        this.transportEmergencyCardIdentifier = transportEmergencyCardIdentifier;  return this;
    }

    public HazardIdentificationPlacardDetailsC235 getHazardIdentificationPlacardDetails() {
        return hazardIdentificationPlacardDetails;
    }

    public DangerousGoods setHazardIdentificationPlacardDetails(HazardIdentificationPlacardDetailsC235 hazardIdentificationPlacardDetails) {
        this.hazardIdentificationPlacardDetails = hazardIdentificationPlacardDetails;  return this;
    }

    public DangerousGoodsLabelC236 getDangerousGoodsLabel() {
        return dangerousGoodsLabel;
    }

    public DangerousGoods setDangerousGoodsLabel(DangerousGoodsLabelC236 dangerousGoodsLabel) {
        this.dangerousGoodsLabel = dangerousGoodsLabel;  return this;
    }

    public String getPackingInstructionTypeCode() {
        return packingInstructionTypeCode;
    }

    public DangerousGoods setPackingInstructionTypeCode(String packingInstructionTypeCode) {
        this.packingInstructionTypeCode = packingInstructionTypeCode;  return this;
    }

    public String getTransportMeansDescriptionCode() {
        return transportMeansDescriptionCode;
    }

    public DangerousGoods setTransportMeansDescriptionCode(String transportMeansDescriptionCode) {
        this.transportMeansDescriptionCode = transportMeansDescriptionCode;  return this;
    }

    public String getHazardousCargoTransportAuthorisationCode() {
        return hazardousCargoTransportAuthorisationCode;
    }

    public DangerousGoods setHazardousCargoTransportAuthorisationCode(String hazardousCargoTransportAuthorisationCode) {
        this.hazardousCargoTransportAuthorisationCode = hazardousCargoTransportAuthorisationCode;  return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy