org.milyn.edi.unedifact.d06b.common.CharacteristicClassId Maven / Gradle / Ivy
/**
* This class was generated by Smooks EJC (http://www.smooks.org).
*/
package org.milyn.edi.unedifact.d06b.common;
import java.io.Serializable;
import org.milyn.smooks.edi.EDIWritable;
import org.milyn.edi.unedifact.d06b.common.field.MeasurementDetailsC502;
import org.milyn.edi.unedifact.d06b.common.field.CharacteristicDescriptionC240;
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 CharacteristicClassId implements Serializable, EDIWritable {
private static final long serialVersionUID = 1L;
private String classTypeCode;
private MeasurementDetailsC502 measurementDetails;
private CharacteristicDescriptionC240 characteristicDescription;
private String characteristicRelevanceCode;
public void write(Writer writer, Delimiters delimiters) throws IOException {
Writer nodeWriter = new StringWriter();
List nodeTokens = new ArrayList();
if(classTypeCode != null) {
nodeWriter.write(delimiters.escape(classTypeCode.toString()));
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(measurementDetails != null) {
measurementDetails.write(nodeWriter, delimiters);
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(characteristicDescription != null) {
characteristicDescription.write(nodeWriter, delimiters);
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(characteristicRelevanceCode != null) {
nodeWriter.write(delimiters.escape(characteristicRelevanceCode.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 getClassTypeCode() {
return classTypeCode;
}
public CharacteristicClassId setClassTypeCode(String classTypeCode) {
this.classTypeCode = classTypeCode; return this;
}
public MeasurementDetailsC502 getMeasurementDetails() {
return measurementDetails;
}
public CharacteristicClassId setMeasurementDetails(MeasurementDetailsC502 measurementDetails) {
this.measurementDetails = measurementDetails; return this;
}
public CharacteristicDescriptionC240 getCharacteristicDescription() {
return characteristicDescription;
}
public CharacteristicClassId setCharacteristicDescription(CharacteristicDescriptionC240 characteristicDescription) {
this.characteristicDescription = characteristicDescription; return this;
}
public String getCharacteristicRelevanceCode() {
return characteristicRelevanceCode;
}
public CharacteristicClassId setCharacteristicRelevanceCode(String characteristicRelevanceCode) {
this.characteristicRelevanceCode = characteristicRelevanceCode; return this;
}
}