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

Add AtomicInteger and AtomicLong converter #406

Closed
Emily-Jiang opened this issue Sep 30, 2020 · 7 comments
Closed

Add AtomicInteger and AtomicLong converter #406

Emily-Jiang opened this issue Sep 30, 2020 · 7 comments
Labels
enhancement New feature or request

Comments

@Emily-Jiang
Copy link
Contributor

As a developer, I would like to have the out of box converters for AtomicInteger and AtomicLong so that I can directly convert a string to these types. I can do the following without doing anything else.

config.getValue("atomic.integer.prop", AtomicInteger.class)
config.getValue("atomic.long.prop", AtomicLong.class)

@dmlloyd
Copy link
Contributor

dmlloyd commented Sep 30, 2020

Is this a real-world requirement or an idea? I think normally we'd want to discourage conversion to classes expressly designed for concurrent mutability.

@Emily-Jiang
Copy link
Contributor Author

In Open Liberty, we have some apps using this and we offer our end users in our own implementation in the past. From now on, we plan to consume SmallRye Config and would like to maintain the capabilities. Besides, I don't see the drawback you mentioned as the type clearly specify the type though. By the way, Archaius Config supports this converter as well.

@radcortez
Copy link
Member

I'm wondering if we should try to keep the core "clean" with just the most common converters and add another module with other type of converters.

We already have a submodule for this reason and the truth is that the great majority of users probably won't use these type of converters. For Liberty, you could just add the extra dependency.

@Emily-Jiang
Copy link
Contributor Author

Sounds good! Which submodule are you referring to? I am thinking about SPI so that the consumer can provide more converters if they need.

@radcortez
Copy link
Member

In here:
https://github.com/smallrye/smallrye-config/tree/master/converters

Anyway, as you remember, I was trying to work on an external Converters project, to maybe even propose as spec, so this may be one more reason to separate the code.

@Emily-Jiang
Copy link
Contributor Author

ah, I see. These converters will be like application provided converters and use service loader patter to be loaded.

@radcortez
Copy link
Member

Yes :)

@radcortez radcortez added the enhancement New feature or request label Jan 7, 2022
@radcortez radcortez closed this as not planned Won't fix, can't repro, duplicate, stale Oct 11, 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

3 participants