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
@chipu that would be pretty easy (see this example). But I think it wouldn't be powerful as I wish: converting things to Map<String,String> would bring some advantage, but since OWNER has a rich set of converter I think that it should be possible to convert to Map<String,Anything> which sounds more convenient. We had some discussions here #52 .
Also I think that a Config object returning a Map<String, ?> could be better mapped to a Config object returning a nested Config object:
interfaceMyConfigextendsConfig {
@DefaultValue("key1:value1 key2:value2")
Map<String, String> map();
}
// would be equivalent, but more convenient, if expressed as:interfaceMyMapextendsConfig {
@DefaultValue("value1");
Stringkey1();
@DefaultValue("value2");
Stringkey2();
}
interfaceMyConfigextendsConfig {
MyMapmap();
}
Basically a Config object can be seen as a map, where the method name is the key, and the returned value is the value. The advantage is that the compiler can check that the key is valid, and the return type matches, and IDE can also apply refactoring.
BTW I see the Map support feature related to the #2
sample property:
sample class:
something()
should return a map containing: foo=1, bar=2, baz=3The text was updated successfully, but these errors were encountered: