use OptionsBuilder, but override with args

Curtis Ullerich curtullerich at gmail.com
Fri Oct 15 21:21:10 UTC 2021


I see the parent(Options other) method of OptionsBuilder and the opposite
seems to be what I want. I'd like to have default options set in main with
OptionsBuilder, and override any of them with command line options. This
could be facilitated several ways, e.g.:
- implementing Options.toBuilder() to use CommandLineOptions as the child
and built Options as the parent.
- implementing OptionsBuilder.fromOptions or OptionsBuilder.merge for the
same

I'm hoping there's an existing way to accomplish this without implementing
a static toBuilder(Options o) in my own package that just gets and sets all
possible fields. Is there?

Thanks,
Curtis


More information about the jmh-dev mailing list