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

org.milyn.edi.unedifact.d96a.common.PartyName 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.d96a.common;

import java.io.Serializable;    
import org.milyn.smooks.edi.EDIWritable;    
import org.milyn.edi.unedifact.d96a.common.field.IdentificationNumberC206;    
import org.milyn.edi.unedifact.d96a.common.field.PartyIdentificationDetailsC082;    
import org.milyn.edi.unedifact.d96a.common.field.NameComponentDetailsC816;    
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 PartyName implements Serializable, EDIWritable {

    private static final long serialVersionUID = 1L;

    private String partyQualifier;
    private IdentificationNumberC206 identificationNumber;
    private PartyIdentificationDetailsC082 partyIdentificationDetails;
    private String nameTypeCoded;
    private String nameStatusCoded;
    private NameComponentDetailsC816 nameComponentDetails1;
    private NameComponentDetailsC816 nameComponentDetails2;
    private NameComponentDetailsC816 nameComponentDetails3;
    private NameComponentDetailsC816 nameComponentDetails4;
    private NameComponentDetailsC816 nameComponentDetails5;

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

        List nodeTokens = new ArrayList();

        if(partyQualifier != null) {
            nodeWriter.write(delimiters.escape(partyQualifier.toString()));
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(identificationNumber != null) {
            identificationNumber.write(nodeWriter, delimiters);
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(partyIdentificationDetails != null) {
            partyIdentificationDetails.write(nodeWriter, delimiters);
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(nameTypeCoded != null) {
            nodeWriter.write(delimiters.escape(nameTypeCoded.toString()));
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(nameStatusCoded != null) {
            nodeWriter.write(delimiters.escape(nameStatusCoded.toString()));
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(nameComponentDetails1 != null) {
            nameComponentDetails1.write(nodeWriter, delimiters);
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(nameComponentDetails2 != null) {
            nameComponentDetails2.write(nodeWriter, delimiters);
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(nameComponentDetails3 != null) {
            nameComponentDetails3.write(nodeWriter, delimiters);
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(nameComponentDetails4 != null) {
            nameComponentDetails4.write(nodeWriter, delimiters);
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(nameComponentDetails5 != null) {
            nameComponentDetails5.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 String getPartyQualifier() {
        return partyQualifier;
    }

    public PartyName setPartyQualifier(String partyQualifier) {
        this.partyQualifier = partyQualifier;  return this;
    }

    public IdentificationNumberC206 getIdentificationNumber() {
        return identificationNumber;
    }

    public PartyName setIdentificationNumber(IdentificationNumberC206 identificationNumber) {
        this.identificationNumber = identificationNumber;  return this;
    }

    public PartyIdentificationDetailsC082 getPartyIdentificationDetails() {
        return partyIdentificationDetails;
    }

    public PartyName setPartyIdentificationDetails(PartyIdentificationDetailsC082 partyIdentificationDetails) {
        this.partyIdentificationDetails = partyIdentificationDetails;  return this;
    }

    public String getNameTypeCoded() {
        return nameTypeCoded;
    }

    public PartyName setNameTypeCoded(String nameTypeCoded) {
        this.nameTypeCoded = nameTypeCoded;  return this;
    }

    public String getNameStatusCoded() {
        return nameStatusCoded;
    }

    public PartyName setNameStatusCoded(String nameStatusCoded) {
        this.nameStatusCoded = nameStatusCoded;  return this;
    }

    public NameComponentDetailsC816 getNameComponentDetails1() {
        return nameComponentDetails1;
    }

    public PartyName setNameComponentDetails1(NameComponentDetailsC816 nameComponentDetails1) {
        this.nameComponentDetails1 = nameComponentDetails1;  return this;
    }

    public NameComponentDetailsC816 getNameComponentDetails2() {
        return nameComponentDetails2;
    }

    public PartyName setNameComponentDetails2(NameComponentDetailsC816 nameComponentDetails2) {
        this.nameComponentDetails2 = nameComponentDetails2;  return this;
    }

    public NameComponentDetailsC816 getNameComponentDetails3() {
        return nameComponentDetails3;
    }

    public PartyName setNameComponentDetails3(NameComponentDetailsC816 nameComponentDetails3) {
        this.nameComponentDetails3 = nameComponentDetails3;  return this;
    }

    public NameComponentDetailsC816 getNameComponentDetails4() {
        return nameComponentDetails4;
    }

    public PartyName setNameComponentDetails4(NameComponentDetailsC816 nameComponentDetails4) {
        this.nameComponentDetails4 = nameComponentDetails4;  return this;
    }

    public NameComponentDetailsC816 getNameComponentDetails5() {
        return nameComponentDetails5;
    }

    public PartyName setNameComponentDetails5(NameComponentDetailsC816 nameComponentDetails5) {
        this.nameComponentDetails5 = nameComponentDetails5;  return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy