Skip to content

Instantly share code, notes, and snippets.

@aasokan
Created February 3, 2015 19:54
Show Gist options
  • Save aasokan/302f7a9cfde71223671d to your computer and use it in GitHub Desktop.
Save aasokan/302f7a9cfde71223671d to your computer and use it in GitHub Desktop.
Binding Constants [Guice]
bindConstant().
annotatedWith(Names.named("maxResults")).
to(10);
@Inject
public void setMaxResults(@Named("maxResults")int maxResults) {
this.maxResults = maxResults;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment