org.milyn.edi.unedifact.d02a.common.EquipmentDetails Maven / Gradle / Ivy
/**
* This class was generated by Smooks EJC (http://www.smooks.org).
*/
package org.milyn.edi.unedifact.d02a.common;
import java.io.Serializable;
import org.milyn.smooks.edi.EDIWritable;
import org.milyn.edi.unedifact.d02a.common.field.EquipmentIdentificationC237;
import org.milyn.edi.unedifact.d02a.common.field.EquipmentSizeAndTypeC224;
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 EquipmentDetails implements Serializable, EDIWritable {
private static final long serialVersionUID = 1L;
private String equipmentTypeCodeQualifier;
private EquipmentIdentificationC237 equipmentIdentification;
private EquipmentSizeAndTypeC224 equipmentSizeAndType;
private String equipmentSupplierCode;
private String equipmentStatusCode;
private String fullOrEmptyIndicatorCode;
public void write(Writer writer, Delimiters delimiters) throws IOException {
Writer nodeWriter = new StringWriter();
List nodeTokens = new ArrayList();
if(equipmentTypeCodeQualifier != null) {
nodeWriter.write(delimiters.escape(equipmentTypeCodeQualifier.toString()));
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(equipmentIdentification != null) {
equipmentIdentification.write(nodeWriter, delimiters);
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(equipmentSizeAndType != null) {
equipmentSizeAndType.write(nodeWriter, delimiters);
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(equipmentSupplierCode != null) {
nodeWriter.write(delimiters.escape(equipmentSupplierCode.toString()));
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(equipmentStatusCode != null) {
nodeWriter.write(delimiters.escape(equipmentStatusCode.toString()));
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(fullOrEmptyIndicatorCode != null) {
nodeWriter.write(delimiters.escape(fullOrEmptyIndicatorCode.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 getEquipmentTypeCodeQualifier() {
return equipmentTypeCodeQualifier;
}
public EquipmentDetails setEquipmentTypeCodeQualifier(String equipmentTypeCodeQualifier) {
this.equipmentTypeCodeQualifier = equipmentTypeCodeQualifier; return this;
}
public EquipmentIdentificationC237 getEquipmentIdentification() {
return equipmentIdentification;
}
public EquipmentDetails setEquipmentIdentification(EquipmentIdentificationC237 equipmentIdentification) {
this.equipmentIdentification = equipmentIdentification; return this;
}
public EquipmentSizeAndTypeC224 getEquipmentSizeAndType() {
return equipmentSizeAndType;
}
public EquipmentDetails setEquipmentSizeAndType(EquipmentSizeAndTypeC224 equipmentSizeAndType) {
this.equipmentSizeAndType = equipmentSizeAndType; return this;
}
public String getEquipmentSupplierCode() {
return equipmentSupplierCode;
}
public EquipmentDetails setEquipmentSupplierCode(String equipmentSupplierCode) {
this.equipmentSupplierCode = equipmentSupplierCode; return this;
}
public String getEquipmentStatusCode() {
return equipmentStatusCode;
}
public EquipmentDetails setEquipmentStatusCode(String equipmentStatusCode) {
this.equipmentStatusCode = equipmentStatusCode; return this;
}
public String getFullOrEmptyIndicatorCode() {
return fullOrEmptyIndicatorCode;
}
public EquipmentDetails setFullOrEmptyIndicatorCode(String fullOrEmptyIndicatorCode) {
this.fullOrEmptyIndicatorCode = fullOrEmptyIndicatorCode; return this;
}
}