MCPcopy Index your code
hub / github.com/google/guice / withAnnotation

Method withAnnotation

core/src/com/google/inject/Key.java:303–305  ·  view source on GitHub ↗

Returns a new key of the same type with the specified annotation. This is equivalent to Key.get(key.getTypeLiteral(), annotation) but may be more convenient to use in certain cases. @since 5.0

(Class<? extends Annotation> annotationType)

Source from the content-addressed store, hash-verified

301 * @since 5.0
302 */
303 public Key<T> withAnnotation(Class<? extends Annotation> annotationType) {
304 return new Key<T>(typeLiteral, strategyFor(annotationType));
305 }
306
307 /**
308 * Returns a new key of the same type with the specified annotation.

Callers 13

testWithAnnotationMethod · 0.80
prepareMethodMethod · 0.80
prepareMethodMethod · 0.80
prepareMethodMethod · 0.80
prepareMethodMethod · 0.80
annotatedWithMethod · 0.80
annotatedWithInternalMethod · 0.80
processSetBindingMethod · 0.80
processMapBindingMethod · 0.80

Calls 1

strategyForMethod · 0.95

Tested by 6

testWithAnnotationMethod · 0.64
prepareMethodMethod · 0.64
prepareMethodMethod · 0.64
prepareMethodMethod · 0.64
prepareMethodMethod · 0.64