Skip to content

Commit

Permalink
Add the target field to Dagger map key types to support Hilt's @BindV…
Browse files Browse the repository at this point in the history
…alueIntoMap.

Fixes #2710

RELNOTES=Add the target field to Dagger map key types to support Hilt's @BindValueIntoMap. #2710
PiperOrigin-RevId: 382413534
  • Loading branch information
Chang-Eric authored and Dagger Team committed Jun 30, 2021
1 parent 408a532 commit 7af40df
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions java/dagger/multibindings/ClassKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

package dagger.multibindings;

import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import dagger.MapKey;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

Expand All @@ -31,7 +31,7 @@
* member whose type is {@code Class<? extends Something>}.
*/
@Documented
@Target(METHOD)
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RUNTIME)
@MapKey
public @interface ClassKey {
Expand Down
4 changes: 2 additions & 2 deletions java/dagger/multibindings/IntKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@

package dagger.multibindings;

import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import dagger.MapKey;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

/** A {@link MapKey} annotation for maps with {@code int} keys. */
@Documented
@Target(METHOD)
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RUNTIME)
@MapKey
public @interface IntKey {
Expand Down
4 changes: 2 additions & 2 deletions java/dagger/multibindings/LongKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@

package dagger.multibindings;

import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import dagger.MapKey;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

/** A {@link MapKey} annotation for maps with {@code long} keys. */
@Documented
@Target(METHOD)
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RUNTIME)
@MapKey
public @interface LongKey {
Expand Down
4 changes: 2 additions & 2 deletions java/dagger/multibindings/StringKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@

package dagger.multibindings;

import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import dagger.MapKey;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

/** A {@link MapKey} annotation for maps with {@link String} keys. */
@Documented
@Target(METHOD)
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RUNTIME)
@MapKey
public @interface StringKey {
Expand Down

0 comments on commit 7af40df

Please sign in to comment.