I think we can translate enums with values to be sealed classes with public static readonly members.
Example:
publicenumLineSeparator {
CR("\r", "CR (\\r)"),
LF("\n", "LF (\\n)"),
CRLF("\r\n", "CRLF (\\r\\n)");
privatefinalStringtext;
privatefinalStringdescription;
LineSeparator(Stringtext, Stringdescription) {
this.text = text;
this.description = description;
}
// ... other methods here
}Output:
publicsealedclassLineSeparator{publicstaticreadonlyLineSeparatorCR=newLineSeparator("\r","CR (\\r)");publicstaticreadonlyLineSeparatorLF=newLineSeparator("\n","LF (\\n)");publicstaticreadonlyLineSeparatorCRLF=newLineSeparator("\r\n","CRLF (\\r\\n)");privatereadonlystringtext;privatereadonlystringdescription;privateLineSeparator(stringtext,stringdescription){this.text=text;this.description=description;}// ... other methods here}
I think we can translate enums with values to be sealed classes with
public static readonlymembers.Example:
Output: