Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[extras] TOML advanced map support #317

Open
Gmugra opened this issue Feb 22, 2022 · 0 comments
Open

[extras] TOML advanced map support #317

Gmugra opened this issue Feb 22, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@Gmugra
Copy link
Owner

Gmugra commented Feb 22, 2022

@Config(sources="classpath:/myconfig.toml")
public interface ConfigMap {

    Map<Integer, String> myMap();
}

At the moment, only way to provide map is "properties" style. e.g. myconfig.toml must be so:

myMap = "8000|One,8001|Two"

Idea is to provide special support for key-postfix e.g. ".map":

[myMap.map]
8000 = "One"
8001 = "Two"

This should porvide same result as before: property with name myMap (without postfix) with Map inside.

Sure is should work with complex use case like array as value with complex object like key. e.g. :

@Config(sources="classpath:/myconfig.toml")
public interface ConfigMap {

    Map<UUID, List<Integer>> complex();
}
[complex.map]
46400000-8cc0-11bd-b43e-10d46e4ef14d = [ 8000, 8001, 8002 ]
46400000-8cc0-11bd-wert-10d46e4ef14d = [ 6000, 6001, 6002 ]
@Gmugra Gmugra added the enhancement New feature or request label Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant