Package-level declarations
Types
Annotates an abstract class or interface used to create an instance of a type via an assisted Inject constructor.
Binds a given type as a type-assignable return type. This is commonly used to bind implementation types to supertypes or to bind them into multibindings.
This annotation is used with ContributesBinding, ContributesIntoSet, and ContributesIntoMap to define a bound type. This is analogous to the bound type of a Binds-annotated declaration.
A MapKey annotation for maps with KClass<*>
keys.
Contributes the annotated interface to the given scope. This is only applicable to interfaces. The downstream merged graph of the same scope will extend this interface in its implementation.
Declares the annotated type to be a dependency graph. Metro's compiler plugin will build, validate, and implement this graph at compile-time.
The callable's return type is a Collection<T>
and all values are contributed to the set. The Collection<T>
produced from the accumulation of values will be immutable. An example use is to provide a default empty set binding, which is otherwise not possible using IntoSet.
This annotation is used to indicate that the annotated declaration expects to have its dependencies injected. This is applicable to multiple targets, the primary form being constructor injection.
The declaration's return type forms the type argument for the value of a Map<K, Provider<V>>
, and the combination of the annotated key and the returned value is contributed to the map as a key/value pair. The Map<K, Provider<V>>
produced from the accumulation of values will be immutable.
The declaration's return type forms the generic type argument of a Set<T>
, and the returned value is contributed to the set. The object graph will pass dependencies to the method as parameters. The Set<T>
produced from the accumulation of values will be immutable.
Identifies annotation types that are used to associate keys with values returned by provider callables in order to compose a map.
Injects dependencies into the properties and functions on instances of type T. Ignores the presence or absence of an injectable constructor.
Annotates abstract module methods that declare multibindings.
This annotation is used on callable declarations in a class to provide instances of a given type to dependency graph. Any class or interface can define providers, but they will not be included unless they are or are a supertype of a DependencyGraph-annotated type.
A qualifier annotation can be used to qualify or otherwise disambiguate a type on a dependency graph. This is useful for primarily two situations:
Marks an annotated annotation class as a scope annotation.
Functions
Creates a new parameter-less graph of type T. Note this is only applicable for graphs that have no creators (i.e. DependencyGraph.Factory).
Creates a new instance of a @DependencyGraph.Factory-annotated class.