Skip to content
Snippets Groups Projects
Commit 95165570 authored by Jonas Blatt's avatar Jonas Blatt :ant:
Browse files

Add action classes for result object

parent b095a837
No related branches found
No related tags found
No related merge requests found
package de.unikoblenz.fgbks.core.dmn.verification.result.actions;
import de.unikoblenz.fgbks.base.builder.DefaultBuilder;
import de.unikoblenz.fgbks.base.domain.Name;
import de.unikoblenz.fgbks.core.dmn.verification.result.AbstractResultObject;
import java.util.HashMap;
import javax.json.bind.annotation.JsonbProperty;
import org.apache.commons.lang3.Validate;
public class Action extends AbstractResultObject {
private static final Name DEFAULT_ACTION_NAME = new Name("Fix");
private ActionType actionType;
private ActionScope actionScope;
private HashMap<String, String> values;
private Name actionName;
private Action() {
values = new HashMap<>();
actionName = DEFAULT_ACTION_NAME;
}
@JsonbProperty("actionType")
public ActionType getActionType() {
return actionType;
}
@JsonbProperty("actionScope")
public ActionScope getActionScope() {
return actionScope;
}
@JsonbProperty("actionValues")
public HashMap<String, String> getValue() {
return new HashMap<>(values);
}
@JsonbProperty("actionName")
public Name getActionName() {
return actionName;
}
private class Builder extends DefaultBuilder<Action> {
public Builder withActionType(ActionType actionType) {
value.actionType = actionType;
return this;
}
public Builder withActionScope(ActionScope actionScope) {
value.actionScope = actionScope;
return this;
}
public Builder addValue(String key, String value) {
this.value.values.put(Validate.notNull(key), value);
return this;
}
public Builder withActionName(Name actionName) {
this.value.actionName = actionName;
return this;
}
@Override
protected void validate() {
super.validate();
}
}
}
package de.unikoblenz.fgbks.core.dmn.verification.result.actions;
public enum ActionScope {
RULE,
INPUT_NODE,
INPUT_COLUMN,
OUTPUT_COLUMN
}
package de.unikoblenz.fgbks.core.dmn.verification.result.actions;
public enum ActionType {
UPDATE,
CREATE,
DELETE
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment