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)
| 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. |