<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<font size="4"><font face="monospace">A few more words on this
suggestion. As of Java 21, we have integrated treatment of
enums and sealed types in switch, so you can freely mix:<br>
<br>
sealed interface Option { }<br>
enum FooOption implements Option { FOO_YES, FOO_NO; }<br>
record BarOption(int maxBars) implements Option { }<br>
<br>
so that options representing "constants" could be handled as
enums rather than records, and options representing data holders
(e.g., attribute mappers) are records, and the two can be
mixed. <br>
<br>
The use site can do:<br>
<br>
ClassfileContext cc = CC.of(FooOption.FOO_YES, new
BarOption(7))<br>
<br>
and a switch over Option can mix enums and record patterns. <br>
<br>
It is probably worth considering recasting some boolean-holder
options as enums.<br>
</font></font><br>
<div class="moz-cite-prefix">On 5/19/2023 11:40 AM, Adam Sotona
wrote:<br>
</div>
<blockquote type="cite" cite="mid:CY4PR1001MB2150BF5CCB1E062DBA8D16268C7C9@CY4PR1001MB2150.namprd10.prod.outlook.com"><span style="font-size:13.5pt;font-family:"Courier
New",serif"><br>
enum ProcessDebugOptions implements Option { <br>
DROP_DEBUG, DROP_DEBUG_ON_READ, DROP_DEBUG_ON_WRITE;<br>
}</span></blockquote>
<br>
</body>
</html>