Enum Class RequestKind

java.lang.Object
java.lang.Enum<RequestKind>
dagger.spi.model.RequestKind
All Implemented Interfaces:
Serializable, Comparable<RequestKind>, Constable

public enum RequestKind extends Enum<RequestKind>
Represents the different kinds of types that may be requested as dependencies for the same key. For example, String, Provider<String>, and Lazy<String> can all be requested if a key exists for String; they have the INSTANCE, PROVIDER, and LAZY request kinds, respectively.
  • Enum Constant Details

    • INSTANCE

      public static final RequestKind INSTANCE
      A default request for an instance. E.g.: FooType
    • PROVIDER

      public static final RequestKind PROVIDER
      A request for a Provider. E.g.: Provider<FooType>
    • LAZY

      public static final RequestKind LAZY
      A request for a Lazy. E.g.: Lazy<FooType>
    • PROVIDER_OF_LAZY

      public static final RequestKind PROVIDER_OF_LAZY
      A request for a Provider of a Lazy. E.g.: Provider<Lazy<FooType>>.
    • MEMBERS_INJECTION

      public static final RequestKind MEMBERS_INJECTION
      A request for a members injection. E.g. void injectMembers(FooType);. Can only be requested by component interfaces.
    • PRODUCER

      public static final RequestKind PRODUCER
      A request for a Producer. E.g.: Producer<FooType>
    • PRODUCED

      public static final RequestKind PRODUCED
      A request for a Produced. E.g.: Produced<FooType>
    • FUTURE

      public static final RequestKind FUTURE
      A request for a ListenableFuture. E.g.: ListenableFuture<FooType>. These can only be requested by component interfaces.
  • Method Details

    • values

      public static RequestKind[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static RequestKind valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • format

      public String format(Key key)
      Returns a string that represents requests of this kind for a key.