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

Move override annotations to inner classes of @ConfigMapping #252

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

radcortez
Copy link
Contributor

No description provided.

@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD })
@interface Default {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if we should provide specialized Default types like @DefaultInt, @DefaultBoolean, etc, or as a member intValue(), booleanValue(). The annotation / member to use has to match the declared type. If another annotation / member is used we could throw a validation error.

This would avoid having to come up with a Conversion strategy from String to something and provide type safety for defaults definition

Copy link
Contributor

@jansupol jansupol May 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One cannot create an extra annotation for each java Type. Rather, the Default value can be a class of data converter. While we have not discussed the converters yet, it looks like it should be discussed before continuing with the @Default annotation.

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

Successfully merging this pull request may close these issues.

2 participants