Skip to content

Commit

Permalink
fix line mode enum
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbai00 committed Jan 7, 2025
1 parent 19644b4 commit 6f8ab79
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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;
Expand Down

0 comments on commit 6f8ab79

Please sign in to comment.