org.milyn.edi.unedifact.d94a.common.TestMethod Maven / Gradle / Ivy
/**
* This class was generated by Smooks EJC (http://www.smooks.org).
*/
package org.milyn.edi.unedifact.d94a.common;
import java.io.Serializable;
import org.milyn.smooks.edi.EDIWritable;
import org.milyn.edi.unedifact.d94a.common.field.TestMethodC244;
import org.milyn.edi.unedifact.d94a.common.field.TestReasonC515;
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 TestMethod implements Serializable, EDIWritable {
private static final long serialVersionUID = 1L;
private TestMethodC244 testMethod;
private String testRouteOfAdministeringCoded;
private String testMediaCoded;
private String measurementApplicationQualifier;
private String testRevisionNumber;
private TestReasonC515 testReason;
public void write(Writer writer, Delimiters delimiters) throws IOException {
Writer nodeWriter = new StringWriter();
List nodeTokens = new ArrayList();
if(testMethod != null) {
testMethod.write(nodeWriter, delimiters);
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(testRouteOfAdministeringCoded != null) {
nodeWriter.write(delimiters.escape(testRouteOfAdministeringCoded.toString()));
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(testMediaCoded != null) {
nodeWriter.write(delimiters.escape(testMediaCoded.toString()));
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(measurementApplicationQualifier != null) {
nodeWriter.write(delimiters.escape(measurementApplicationQualifier.toString()));
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(testRevisionNumber != null) {
nodeWriter.write(delimiters.escape(testRevisionNumber.toString()));
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(testReason != null) {
testReason.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 TestMethodC244 getTestMethod() {
return testMethod;
}
public TestMethod setTestMethod(TestMethodC244 testMethod) {
this.testMethod = testMethod; return this;
}
public String getTestRouteOfAdministeringCoded() {
return testRouteOfAdministeringCoded;
}
public TestMethod setTestRouteOfAdministeringCoded(String testRouteOfAdministeringCoded) {
this.testRouteOfAdministeringCoded = testRouteOfAdministeringCoded; return this;
}
public String getTestMediaCoded() {
return testMediaCoded;
}
public TestMethod setTestMediaCoded(String testMediaCoded) {
this.testMediaCoded = testMediaCoded; return this;
}
public String getMeasurementApplicationQualifier() {
return measurementApplicationQualifier;
}
public TestMethod setMeasurementApplicationQualifier(String measurementApplicationQualifier) {
this.measurementApplicationQualifier = measurementApplicationQualifier; return this;
}
public String getTestRevisionNumber() {
return testRevisionNumber;
}
public TestMethod setTestRevisionNumber(String testRevisionNumber) {
this.testRevisionNumber = testRevisionNumber; return this;
}
public TestReasonC515 getTestReason() {
return testReason;
}
public TestMethod setTestReason(TestReasonC515 testReason) {
this.testReason = testReason; return this;
}
}