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:
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: