Skip to content

Instantly share code, notes, and snippets.

@drawers
Created August 7, 2017 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drawers/2ae521ea2a59c477934a2bba4c0dbffa to your computer and use it in GitHub Desktop.
Save drawers/2ae521ea2a59c477934a2bba4c0dbffa to your computer and use it in GitHub Desktop.
@ProducerModule(includes = { PlayerRepositoryModule.class, GamesRepositoryModule.class, PlayerNameModule.class } )
final class MainRequestModule {
@Produces
static ListenableFuture<Player> player(PlayerRepository playerRepository, String playerName) {
return playerRepository.retrieve(playerName);
}
@Produces
static ListenableFuture<Games> games(GamesRepository gamesRepository, Player player) {
return gamesRepository.retrieve(player.id());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment