poussecafe.doc.model.processstepdoc.ProcessStepDocData Maven / Gradle / Ivy
package poussecafe.doc.model.processstepdoc;
import java.io.Serializable;
import java.util.HashSet;
import poussecafe.attribute.Attribute;
import poussecafe.attribute.AttributeBuilder;
import poussecafe.attribute.OptionalAttribute;
import poussecafe.attribute.SetAttribute;
import poussecafe.doc.model.BoundedContextComponentDoc;
import poussecafe.doc.model.BoundedContextComponentDocData;
@SuppressWarnings("serial")
public class ProcessStepDocData implements Serializable, ProcessStepDoc.Attributes {
@Override
public Attribute identifier() {
return AttributeBuilder.stringId(ProcessStepDocId.class)
.read(() -> id)
.write(value -> id = value)
.build();
}
private String id;
@Override
public Attribute boundedContextComponentDoc() {
return AttributeBuilder.single(BoundedContextComponentDoc.class)
.usingAutoAdapter(BoundedContextComponentDocData.class)
.read(() -> boundedContextComponentDoc)
.write(value -> boundedContextComponentDoc = value)
.build();
}
private BoundedContextComponentDocData boundedContextComponentDoc;
@Override
public SetAttribute producedEvents() {
return AttributeBuilder.set(String.class)
.withSet(producedEvents)
.build();
}
private HashSet producedEvents = new HashSet<>();
@Override
public OptionalAttribute processName() {
return AttributeBuilder.optional(String.class)
.read(() -> processName)
.write(value -> processName = value)
.build();
}
private String processName;
@Override
public OptionalAttribute stepMethodSignature() {
return AttributeBuilder.optional(StepMethodSignature.class)
.usingAutoAdapter(StepMethodSignatureData.class)
.read(() -> stepMethodSignature)
.write(value -> stepMethodSignature = value)
.build();
}
private StepMethodSignatureData stepMethodSignature;
@Override
public SetAttribute toExternals() {
return AttributeBuilder.set(String.class)
.withSet(toExternals)
.build();
}
private HashSet toExternals = new HashSet<>();
@Override
public SetAttribute fromExternals() {
return AttributeBuilder.set(String.class)
.withSet(fromExternals)
.build();
}
private HashSet fromExternals = new HashSet<>();
}