Skip to content

Instantly share code, notes, and snippets.

@rethab
Created September 12, 2016 09:49
Show Gist options
  • Save rethab/eae69d672223c165eacd3b2d175c6a2c to your computer and use it in GitHub Desktop.
Save rethab/eae69d672223c165eacd3b2d175c6a2c to your computer and use it in GitHub Desktop.
get instance by named annotation from guice injector with the play framework
import play.api.inject.{QualifierInstance, BindingKey}
import com.google.inject.name.Names
val injector = ???
injector.instanceOf(BindingKey(classOf[MyType], Some(QualifierInstance(Names.named("my-thing")))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment