package net.gepafin.tendermanagement.enums; import com.fasterxml.jackson.annotation.JsonValue; public enum MatchModeEnum { STARTSWITH("Starts with"), ENDSWITH("Ends with"), CONTAINS("Contains"), EQUALS("Equals"), DATEIS("Date is"), DATEISNOT("Date is not"), BEFORE("Date is before"), AFTER("Date is after"); private String value; MatchModeEnum(String value) { this.value = value; } public static MatchModeEnum fromObject(Object value) { if (value instanceof String) { String strValue = ((String) value).trim(); for (MatchModeEnum mode : MatchModeEnum.values()) { if (mode.getValue().equalsIgnoreCase(strValue)) { return mode; } } } throw new IllegalArgumentException("Invalid MatchModeEnum: " + value); } @JsonValue public String getValue() { return value; } }