You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ConfigBeanFactory.create supports the ability to create a typed object with a single method call which is very nice. I am using java 17 and would like to use a record instead of a java bean to take advantage of the much reduced boilerplate possible when using java records.
My proposal is something along the lines of the following:
record MyConfig(String uri, Integer port);
var map = Map.of(
"uri", "localhost",
"port", "1234");
var fullConfig = ConfigFactory.parseMap(map)
var myConfig = ConfigRecordFactory.create(fullConfig, MyConfig.class);
assertThat(myConfig.uri(), equalTo("localhost"));
assertThat(myConfig.port(), equalTo("1234"));
Thanks for this great library!
The text was updated successfully, but these errors were encountered:
As far as I can see, the project is not in active development, however, this feature would be very useful and convenient. Also, I see that the current open pull requests are not accepted. I can take on the implementation of this feature, but I would not like to waste time if the pull request will be rejected in any case.
@havocp You are the most active contributor to the library, can you please comment on whether I can take on the implementation?
ConfigBeanFactory.create
supports the ability to create a typed object with a single method call which is very nice. I am using java 17 and would like to use arecord
instead of a java bean to take advantage of the much reduced boilerplate possible when using java records.My proposal is something along the lines of the following:
Thanks for this great library!
The text was updated successfully, but these errors were encountered: