With @Provides annotation, I am curious what is the function name requirement.
@Provides
TypeA ProvideTypeA()
{
...
return TypeA
}
Is it OK to use a different function name?
@Provides
TypeA AnyName()
{
...
return TypeA
}
With @Provides annotation, I am curious what is the function name requirement.
@Provides
TypeA ProvideTypeA()
{
...
return TypeA
}
Is it OK to use a different function name?
@Provides
TypeA AnyName()
{
...
return TypeA
}
You may call your method foo
, provideFoo
or anyNameThatYouWant
, it won't matter.
The things that matter are the return-type, parameter-types and the binding annotations (if any, in addition to @Provides
).