org.milyn.edi.unedifact.d96a.common.NameAndAddress Maven / Gradle / Ivy
/**
* 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.PartyIdentificationDetailsC082;
import org.milyn.edi.unedifact.d96a.common.field.NameAndAddressC058;
import org.milyn.edi.unedifact.d96a.common.field.PartyNameC080;
import org.milyn.edi.unedifact.d96a.common.field.StreetC059;
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 NameAndAddress implements Serializable, EDIWritable {
private static final long serialVersionUID = 1L;
private String partyQualifier;
private PartyIdentificationDetailsC082 partyIdentificationDetails;
private NameAndAddressC058 nameAndAddress;
private PartyNameC080 partyName;
private StreetC059 street;
private String cityName;
private String countrySubEntityIdentification;
private String postcodeIdentification;
private String countryCoded;
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(partyIdentificationDetails != null) {
partyIdentificationDetails.write(nodeWriter, delimiters);
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(nameAndAddress != null) {
nameAndAddress.write(nodeWriter, delimiters);
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(partyName != null) {
partyName.write(nodeWriter, delimiters);
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(street != null) {
street.write(nodeWriter, delimiters);
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(cityName != null) {
nodeWriter.write(delimiters.escape(cityName.toString()));
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(countrySubEntityIdentification != null) {
nodeWriter.write(delimiters.escape(countrySubEntityIdentification.toString()));
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(postcodeIdentification != null) {
nodeWriter.write(delimiters.escape(postcodeIdentification.toString()));
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(countryCoded != null) {
nodeWriter.write(delimiters.escape(countryCoded.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 getPartyQualifier() {
return partyQualifier;
}
public NameAndAddress setPartyQualifier(String partyQualifier) {
this.partyQualifier = partyQualifier; return this;
}
public PartyIdentificationDetailsC082 getPartyIdentificationDetails() {
return partyIdentificationDetails;
}
public NameAndAddress setPartyIdentificationDetails(PartyIdentificationDetailsC082 partyIdentificationDetails) {
this.partyIdentificationDetails = partyIdentificationDetails; return this;
}
public NameAndAddressC058 getNameAndAddress() {
return nameAndAddress;
}
public NameAndAddress setNameAndAddress(NameAndAddressC058 nameAndAddress) {
this.nameAndAddress = nameAndAddress; return this;
}
public PartyNameC080 getPartyName() {
return partyName;
}
public NameAndAddress setPartyName(PartyNameC080 partyName) {
this.partyName = partyName; return this;
}
public StreetC059 getStreet() {
return street;
}
public NameAndAddress setStreet(StreetC059 street) {
this.street = street; return this;
}
public String getCityName() {
return cityName;
}
public NameAndAddress setCityName(String cityName) {
this.cityName = cityName; return this;
}
public String getCountrySubEntityIdentification() {
return countrySubEntityIdentification;
}
public NameAndAddress setCountrySubEntityIdentification(String countrySubEntityIdentification) {
this.countrySubEntityIdentification = countrySubEntityIdentification; return this;
}
public String getPostcodeIdentification() {
return postcodeIdentification;
}
public NameAndAddress setPostcodeIdentification(String postcodeIdentification) {
this.postcodeIdentification = postcodeIdentification; return this;
}
public String getCountryCoded() {
return countryCoded;
}
public NameAndAddress setCountryCoded(String countryCoded) {
this.countryCoded = countryCoded; return this;
}
}