diff --git a/core/workflow-operator/src/main/scala/edu/uci/ics/amber/operator/visualization/lineChart/LineMode.java b/core/workflow-operator/src/main/scala/edu/uci/ics/amber/operator/visualization/lineChart/LineMode.java index 3542d13995..7abe3be6be 100644 --- a/core/workflow-operator/src/main/scala/edu/uci/ics/amber/operator/visualization/lineChart/LineMode.java +++ b/core/workflow-operator/src/main/scala/edu/uci/ics/amber/operator/visualization/lineChart/LineMode.java @@ -1,5 +1,6 @@ package edu.uci.ics.amber.operator.visualization.lineChart; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; public enum LineMode { @@ -12,6 +13,17 @@ public enum LineMode { this.mode = mode; } + // Handle custom deserialization for enum + @JsonCreator + public static LineMode fromString(String value) { + for (LineMode mode : LineMode.values()) { + if (mode.mode.equalsIgnoreCase(value)) { + return mode; + } + } + throw new IllegalArgumentException("Unknown line mode: " + value); + } + @JsonValue public String getMode() { return mode;