I think we can translate enums with values to be sealed classes with public static readonly members.
Example:
public enum LineSeparator {
CR("\r", "CR (\\r)"),
LF("\n", "LF (\\n)"),
CRLF("\r\n", "CRLF (\\r\\n)");
private final String text;
private final String description;
LineSeparator(String text, String description) {
this.text = text;
this.description = description;
}
// ... other methods here
}
Output:
public sealed class LineSeparator
{
public static readonly LineSeparator CR = new LineSeparator("\r", "CR (\\r)");
public static readonly LineSeparator LF = new LineSeparator("\n", "LF (\\n)");
public static readonly LineSeparator CRLF = new LineSeparator("\r\n", "CRLF (\\r\\n)");
private readonly string text;
private readonly string description;
private LineSeparator(string text, string description)
{
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: