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

Provide JDK type conversions #44

Open
Emily-Jiang opened this issue Jan 27, 2022 · 2 comments
Open

Provide JDK type conversions #44

Emily-Jiang opened this issue Jan 27, 2022 · 2 comments

Comments

@Emily-Jiang
Copy link
Contributor

As a user of the configuration API and/or injection mechanisms, I expect there to be a range of default value type conversions so that I can have configuration values of common JDK value types without having to explicitly enable or implement those conversions.
Source: #27 (comment)

@Emily-Jiang
Copy link
Contributor Author

Emily-Jiang commented Jan 27, 2022

As app developer, I want to read single configured values of various other basic Java Types like int, Integer, long, LocalDate, LocalDateTime

Those are also used a lot in applications. It should be easy to consume configuration of those types out of the box.

This covers a Java class with valueOf, parse etc. These types should be an automatic converter class.

@tomas-langer
Copy link
Contributor

As written, this would require reflection. I think we should not mandate reflection as part of this specification.
If we want to support valueOf or parse for ANY type, we would need to use reflection at runtime, which is against trends (and peformance).
If we still want to have support for additional types, we would need to add some way to mark such types, so they can be processed at build time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants