1 /*
2  * Copyright (C) 2023 The Dagger Authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package app
18 
19 import dagger.Component
20 import library1.AssistedFoo
21 import library1.Foo
22 import library1.MyBaseComponent
23 import library1.MyComponentDependency
24 import library1.MyComponentDependencyBinding
25 import library1.MyComponentModule
26 import library1.MySubcomponentWithBuilder
27 import library1.MySubcomponentWithFactory
28 import library1.MyQualifier
29 import javax.inject.Singleton
30 import library1.MyComponentModule.ScopedQualifiedBindsType
31 import library1.MyComponentModule.ScopedUnqualifiedBindsType
32 import library1.MyComponentModule.UnscopedQualifiedBindsType
33 import library1.MyComponentModule.UnscopedUnqualifiedBindsType
34 import library1.MyComponentModule.ScopedQualifiedProvidesType
35 import library1.MyComponentModule.ScopedUnqualifiedProvidesType
36 import library1.MyComponentModule.UnscopedQualifiedProvidesType
37 import library1.MyComponentModule.UnscopedUnqualifiedProvidesType
38 
39 @Singleton
40 @Component(dependencies = [MyComponentDependency::class], modules = [MyComponentModule::class])
41 internal abstract class MyComponent : MyBaseComponent() {
foonull42     abstract fun foo(): Foo
43     @MyQualifier
44     abstract fun scopedQualifiedBindsType(): ScopedQualifiedBindsType
45     abstract fun assistedFooFactory(): AssistedFoo.Factory
46     @MyQualifier
47     abstract fun unscopedQualifiedBindsType(): UnscopedQualifiedBindsType
48     abstract fun scopedUnqualifiedBindsType(): ScopedUnqualifiedBindsType
49     @MyQualifier
50     abstract fun scopedQualifiedProvidesType(): ScopedQualifiedProvidesType
51     abstract fun unscopedUnqualifiedBindsType(): UnscopedUnqualifiedBindsType
52     @MyQualifier
53     abstract fun unscopedQualifiedProvidesType(): UnscopedQualifiedProvidesType
54     abstract fun scopedUnqualifiedProvidesType(): ScopedUnqualifiedProvidesType
55     abstract fun unscopedUnqualifiedProvidesType(): UnscopedUnqualifiedProvidesType
56     abstract fun mySubcomponentWithFactory(): MySubcomponentWithFactory.Factory
57     abstract fun mySubcomponentWithBuilder(): MySubcomponentWithBuilder.Builder
58     @MyQualifier
59     abstract fun qualifiedMyComponentDependencyBinding(): MyComponentDependencyBinding
60     abstract fun unqualifiedMyComponentDependencyBinding(): MyComponentDependencyBinding
61 
62 
63     @Component.Factory
64     internal abstract class Factory : MyBaseComponent.Factory() {
65         abstract override fun create(
66             myComponentModule: MyComponentModule,
67             myComponentDependency: MyComponentDependency
68         ): MyComponent
69     }
70 }
71