org.milyn.edi.unedifact.d96a.common.GoodsIdentityNumber 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.IdentityNumberRangeC208;
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 GoodsIdentityNumber implements Serializable, EDIWritable {
private static final long serialVersionUID = 1L;
private String identityNumberQualifier;
private IdentityNumberRangeC208 identityNumberRange1;
private IdentityNumberRangeC208 identityNumberRange2;
private IdentityNumberRangeC208 identityNumberRange3;
private IdentityNumberRangeC208 identityNumberRange4;
private IdentityNumberRangeC208 identityNumberRange5;
public void write(Writer writer, Delimiters delimiters) throws IOException {
Writer nodeWriter = new StringWriter();
List nodeTokens = new ArrayList();
if(identityNumberQualifier != null) {
nodeWriter.write(delimiters.escape(identityNumberQualifier.toString()));
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(identityNumberRange1 != null) {
identityNumberRange1.write(nodeWriter, delimiters);
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(identityNumberRange2 != null) {
identityNumberRange2.write(nodeWriter, delimiters);
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(identityNumberRange3 != null) {
identityNumberRange3.write(nodeWriter, delimiters);
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(identityNumberRange4 != null) {
identityNumberRange4.write(nodeWriter, delimiters);
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(identityNumberRange5 != null) {
identityNumberRange5.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 getIdentityNumberQualifier() {
return identityNumberQualifier;
}
public GoodsIdentityNumber setIdentityNumberQualifier(String identityNumberQualifier) {
this.identityNumberQualifier = identityNumberQualifier; return this;
}
public IdentityNumberRangeC208 getIdentityNumberRange1() {
return identityNumberRange1;
}
public GoodsIdentityNumber setIdentityNumberRange1(IdentityNumberRangeC208 identityNumberRange1) {
this.identityNumberRange1 = identityNumberRange1; return this;
}
public IdentityNumberRangeC208 getIdentityNumberRange2() {
return identityNumberRange2;
}
public GoodsIdentityNumber setIdentityNumberRange2(IdentityNumberRangeC208 identityNumberRange2) {
this.identityNumberRange2 = identityNumberRange2; return this;
}
public IdentityNumberRangeC208 getIdentityNumberRange3() {
return identityNumberRange3;
}
public GoodsIdentityNumber setIdentityNumberRange3(IdentityNumberRangeC208 identityNumberRange3) {
this.identityNumberRange3 = identityNumberRange3; return this;
}
public IdentityNumberRangeC208 getIdentityNumberRange4() {
return identityNumberRange4;
}
public GoodsIdentityNumber setIdentityNumberRange4(IdentityNumberRangeC208 identityNumberRange4) {
this.identityNumberRange4 = identityNumberRange4; return this;
}
public IdentityNumberRangeC208 getIdentityNumberRange5() {
return identityNumberRange5;
}
public GoodsIdentityNumber setIdentityNumberRange5(IdentityNumberRangeC208 identityNumberRange5) {
this.identityNumberRange5 = identityNumberRange5; return this;
}
}