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

Improve support for requests for optional services #1

Open
realityforge opened this issue Feb 26, 2020 · 0 comments
Open

Improve support for requests for optional services #1

realityforge opened this issue Feb 26, 2020 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@realityforge
Copy link
Collaborator

realityforge commented Feb 26, 2020

The current version (i.e. v0.05) supports adding the @Nullable annotation when requesting a service. If the service is not available then a null is returned. Other forms of service requests for optional services should be supported.

You should be able to add the following types as constructor parameters in @Injectable types or as provider method parameters in @Fragment annotated types.

  • @Nullable T
  • Optional<T>
  • Supplier<Optional<T>
  • Collection<Supplier<Optional<T>

We should also add support for nullability when requesting Collection<T> by just omitting service from collection.

There is no real reason not to add this other than it requires additional engineering effort and there is no application that requires this functionality at this stage.

@realityforge realityforge added enhancement New feature or request help wanted Extra attention is needed labels Feb 26, 2020
realityforge added a commit that referenced this issue Feb 26, 2020
@realityforge realityforge removed the help wanted Extra attention is needed label Feb 27, 2020
@realityforge realityforge added this to the 1.0 milestone Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant