Skip to content

Generate Value Classes When on Valhalla #660

New issue

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

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

Already on GitHub? # to your account

Merged
merged 4 commits into from
Aug 1, 2024
Merged

Conversation

SentryMan
Copy link
Collaborator

@SentryMan SentryMan commented Jul 31, 2024

Was testing with valhalla, and thought why not?

  • will generate value classes if on a valhalla JDK build and previews are enabled
  • Modifies generated module classes to work as value types (no mutable fields)
@Generated
@InjectModule
public final value class ApiModule implements AvajeModule {
  @Override
  public void build(Builder builder) {
    // builder is now passed into the DI methods instead of being a field
    build_config_HttpClientFactory(builder);
  }
...

@SentryMan SentryMan added this to the 10.3 milestone Jul 31, 2024
@SentryMan SentryMan requested a review from rbygrave July 31, 2024 23:17
@SentryMan SentryMan self-assigned this Jul 31, 2024
@SentryMan SentryMan changed the title Write Value Classes When on Valhalla Generate Value Classes When on Valhalla Aug 1, 2024
@SentryMan
Copy link
Collaborator Author

Alright, I'm good with this

@rbygrave rbygrave merged commit b204598 into avaje:master Aug 1, 2024
7 checks passed
@SentryMan SentryMan deleted the valhalla branch August 1, 2024 11:25
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants