org.milyn.edi.unedifact.d05a.common.Event Maven / Gradle / Ivy
/**
* This class was generated by Smooks EJC (http://www.smooks.org).
*/
package org.milyn.edi.unedifact.d05a.common;
import java.io.Serializable;
import org.milyn.smooks.edi.EDIWritable;
import org.milyn.edi.unedifact.d05a.common.field.EventCategoryC004;
import org.milyn.edi.unedifact.d05a.common.field.EventTypeC030;
import org.milyn.edi.unedifact.d05a.common.field.EventIdentificationC063;
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 Event implements Serializable, EDIWritable {
private static final long serialVersionUID = 1L;
private String eventDetailsCodeQualifier;
private EventCategoryC004 eventCategory;
private EventTypeC030 eventType;
private EventIdentificationC063 eventIdentification;
private String actionRequestNotificationDescriptionCode;
public void write(Writer writer, Delimiters delimiters) throws IOException {
Writer nodeWriter = new StringWriter();
List nodeTokens = new ArrayList();
if(eventDetailsCodeQualifier != null) {
nodeWriter.write(delimiters.escape(eventDetailsCodeQualifier.toString()));
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(eventCategory != null) {
eventCategory.write(nodeWriter, delimiters);
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(eventType != null) {
eventType.write(nodeWriter, delimiters);
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(eventIdentification != null) {
eventIdentification.write(nodeWriter, delimiters);
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(actionRequestNotificationDescriptionCode != null) {
nodeWriter.write(delimiters.escape(actionRequestNotificationDescriptionCode.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 getEventDetailsCodeQualifier() {
return eventDetailsCodeQualifier;
}
public Event setEventDetailsCodeQualifier(String eventDetailsCodeQualifier) {
this.eventDetailsCodeQualifier = eventDetailsCodeQualifier; return this;
}
public EventCategoryC004 getEventCategory() {
return eventCategory;
}
public Event setEventCategory(EventCategoryC004 eventCategory) {
this.eventCategory = eventCategory; return this;
}
public EventTypeC030 getEventType() {
return eventType;
}
public Event setEventType(EventTypeC030 eventType) {
this.eventType = eventType; return this;
}
public EventIdentificationC063 getEventIdentification() {
return eventIdentification;
}
public Event setEventIdentification(EventIdentificationC063 eventIdentification) {
this.eventIdentification = eventIdentification; return this;
}
public String getActionRequestNotificationDescriptionCode() {
return actionRequestNotificationDescriptionCode;
}
public Event setActionRequestNotificationDescriptionCode(String actionRequestNotificationDescriptionCode) {
this.actionRequestNotificationDescriptionCode = actionRequestNotificationDescriptionCode; return this;
}
}