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

org.milyn.edi.unedifact.d06b.common.ADRAddress 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.d06b.common;

import java.io.Serializable;    
import org.milyn.smooks.edi.EDIWritable;    
import org.milyn.edi.unedifact.d06b.common.field.C817AddressUsage;    
import org.milyn.edi.unedifact.d06b.common.field.C090AddressDetails;    
import org.milyn.edi.unedifact.d06b.common.field.C819CountrySubdivisionDetails;    
import org.milyn.edi.unedifact.d06b.common.field.C517LocationIdentification;    
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 ADRAddress implements Serializable, EDIWritable {

    private static final long serialVersionUID = 1L;

    private C817AddressUsage c817AddressUsage;
    private C090AddressDetails c090AddressDetails;
    private String e3164CityName;
    private String e3251PostalIdentificationCode;
    private String e3207CountryIdentifier;
    private C819CountrySubdivisionDetails c819CountrySubdivisionDetails;
    private C517LocationIdentification c517LocationIdentification;

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

        List nodeTokens = new ArrayList();

        if(c817AddressUsage != null) {
            c817AddressUsage.write(nodeWriter, delimiters);
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(c090AddressDetails != null) {
            c090AddressDetails.write(nodeWriter, delimiters);
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(e3164CityName != null) {
            nodeWriter.write(delimiters.escape(e3164CityName.toString()));
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(e3251PostalIdentificationCode != null) {
            nodeWriter.write(delimiters.escape(e3251PostalIdentificationCode.toString()));
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(e3207CountryIdentifier != null) {
            nodeWriter.write(delimiters.escape(e3207CountryIdentifier.toString()));
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(c819CountrySubdivisionDetails != null) {
            c819CountrySubdivisionDetails.write(nodeWriter, delimiters);
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(c517LocationIdentification != null) {
            c517LocationIdentification.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 C817AddressUsage getC817AddressUsage() {
        return c817AddressUsage;
    }

    public ADRAddress setC817AddressUsage(C817AddressUsage c817AddressUsage) {
        this.c817AddressUsage = c817AddressUsage;  return this;
    }

    public C090AddressDetails getC090AddressDetails() {
        return c090AddressDetails;
    }

    public ADRAddress setC090AddressDetails(C090AddressDetails c090AddressDetails) {
        this.c090AddressDetails = c090AddressDetails;  return this;
    }

    public String getE3164CityName() {
        return e3164CityName;
    }

    public ADRAddress setE3164CityName(String e3164CityName) {
        this.e3164CityName = e3164CityName;  return this;
    }

    public String getE3251PostalIdentificationCode() {
        return e3251PostalIdentificationCode;
    }

    public ADRAddress setE3251PostalIdentificationCode(String e3251PostalIdentificationCode) {
        this.e3251PostalIdentificationCode = e3251PostalIdentificationCode;  return this;
    }

    public String getE3207CountryIdentifier() {
        return e3207CountryIdentifier;
    }

    public ADRAddress setE3207CountryIdentifier(String e3207CountryIdentifier) {
        this.e3207CountryIdentifier = e3207CountryIdentifier;  return this;
    }

    public C819CountrySubdivisionDetails getC819CountrySubdivisionDetails() {
        return c819CountrySubdivisionDetails;
    }

    public ADRAddress setC819CountrySubdivisionDetails(C819CountrySubdivisionDetails c819CountrySubdivisionDetails) {
        this.c819CountrySubdivisionDetails = c819CountrySubdivisionDetails;  return this;
    }

    public C517LocationIdentification getC517LocationIdentification() {
        return c517LocationIdentification;
    }

    public ADRAddress setC517LocationIdentification(C517LocationIdentification c517LocationIdentification) {
        this.c517LocationIdentification = c517LocationIdentification;  return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy