Package dagger.model

Enum RequestKind

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<RequestKind>

    public enum RequestKind
    extends java.lang.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 Summary

      Enum Constants 
      Enum Constant Description
      FUTURE
      A request for a ListenableFuture.
      INSTANCE
      A default request for an instance.
      LAZY
      A request for a Lazy.
      MEMBERS_INJECTION
      A request for a members injection.
      PRODUCED
      A request for a Produced.
      PRODUCER
      A request for a Producer.
      PROVIDER
      A request for a Provider.
      PROVIDER_OF_LAZY
      A request for a Provider of a Lazy.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String format​(Key key)
      Returns a string that represents requests of this kind for a key.
      static RequestKind valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static RequestKind[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • 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 Detail

      • values

        public static RequestKind[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (RequestKind c : RequestKind.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static RequestKind valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • format

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