xref: /aosp_15_r20/external/dagger2/javatests/dagger/functional/kotlinsrc/basic/BasicComponent.kt (revision f585d8a307d0621d6060bd7e80091fdcbf94fe27)
1 /*
2  * Copyright (C) 2022 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 dagger.functional.kotlinsrc.basic
18 
19 import dagger.Component
20 import dagger.Lazy
21 import dagger.MembersInjector
22 import javax.inject.Provider
23 
24 @Component(modules = [PrimitivesModule::class, NullableModule::class])
25 interface BasicComponent :
26   Injector<Thing>,
27   // Implements two types that define the same method, not overridden here, to test that the
28   // method is implemented only once.
29   ComponentSupertypeOne,
30   ComponentSupertypeTwo {
31 
byteFunnull32   fun byteFun(): Byte
33   fun charFun(): Char
34   fun shortFun(): Short
35   fun intFun(): Int
36   fun longFun(): Long
37   fun booleanFun(): Boolean
38   fun floatFun(): Float
39   fun doubleFun(): Double
40 
41   fun byteProviderFun(): Provider<Byte>
42   fun charProviderFun(): Provider<Char>
43   fun shortProviderFun(): Provider<Short>
44   fun intProviderFun(): Provider<Int>
45   fun longProviderFun(): Provider<Long>
46   fun booleanProviderFun(): Provider<Boolean>
47   fun floatProviderFun(): Provider<Float>
48   fun doubleProviderFun(): Provider<Double>
49 
50   fun byteArrayFun(): ByteArray
51   fun charArrayFun(): CharArray
52   fun shortArrayFun(): ShortArray
53   fun intArrayFun(): IntArray
54   fun longArrayFun(): LongArray
55   fun booleanArrayFun(): BooleanArray
56   fun floatArrayFun(): FloatArray
57   fun doubleArrayFun(): DoubleArray
58 
59   fun byteArrayProviderFun(): Provider<ByteArray>
60   fun charArrayProviderFun(): Provider<CharArray>
61   fun shortArrayProviderFun(): Provider<ShortArray>
62   fun intArrayProviderFun(): Provider<IntArray>
63   fun longArrayProviderFun(): Provider<LongArray>
64   fun booleanArrayProviderFun(): Provider<BooleanArray>
65   fun floatArrayProviderFun(): Provider<FloatArray>
66   fun doubleArrayProviderFun(): Provider<DoubleArray>
67 
68   fun noOpMembersInjectionFun(obviouslyDoesNotHaveMembersToInject: Any): Any
69 
70   fun thingFun(): Thing
71   fun injectedThingFun(): InjectedThing
72   fun injectedThingProviderFun(): Provider<InjectedThing>
73   fun lazyInjectedThingFun(): Lazy<InjectedThing>
74   fun lazyInjectedThingProviderFun(): Provider<Lazy<InjectedThing>>
75   fun injectedThingMembersInjectorFun(): MembersInjector<InjectedThing>
76 
77   fun nullObjectFun(): Any?
78   fun nullObjectProviderFun(): Provider<Any>
79   fun lazyNullObjectFun(): Lazy<Any>
80   fun typeWithInheritedMembersInjectionFun(): TypeWithInheritedMembersInjection
81   fun typeWithInheritedMembersInjectionMembersInjectorFun():
82     MembersInjector<TypeWithInheritedMembersInjection>
83 
84   val byteVal: Byte
85   val charVal: Char
86   val shortVal: Short
87   val intVal: Int
88   val longVal: Long
89   val booleanVal: Boolean
90   val floatVal: Float
91   val doubleVal: Double
92 
93   val byteProviderVal: Provider<Byte>
94   val charProviderVal: Provider<Char>
95   val shortProviderVal: Provider<Short>
96   val intProviderVal: Provider<Int>
97   val longProviderVal: Provider<Long>
98   val booleanProviderVal: Provider<Boolean>
99   val floatProviderVal: Provider<Float>
100   val doubleProviderVal: Provider<Double>
101 
102   val byteArrayVal: ByteArray
103   val charArrayVal: CharArray
104   val shortArrayVal: ShortArray
105   val intArrayVal: IntArray
106   val longArrayVal: LongArray
107   val booleanArrayVal: BooleanArray
108   val floatArrayVal: FloatArray
109   val doubleArrayVal: DoubleArray
110 
111   val byteArrayProviderVal: Provider<ByteArray>
112   val charArrayProviderVal: Provider<CharArray>
113   val shortArrayProviderVal: Provider<ShortArray>
114   val intArrayProviderVal: Provider<IntArray>
115   val longArrayProviderVal: Provider<LongArray>
116   val booleanArrayProviderVal: Provider<BooleanArray>
117   val floatArrayProviderVal: Provider<FloatArray>
118   val doubleArrayProviderVal: Provider<DoubleArray>
119 
120   val thingVal: Thing
121   val injectedThingVal: InjectedThing
122   val injectedThingProviderVal: Provider<InjectedThing>
123   val lazyInjectedThingVal: Lazy<InjectedThing>
124   val lazyInjectedThingProviderVal: Provider<Lazy<InjectedThing>>
125   val injectedThingMembersInjectorVal: MembersInjector<InjectedThing>
126 
127   val nullObjectVal: Any?
128   val nullObjectProviderVal: Provider<Any>
129   val lazyNullObjectVal: Lazy<Any>
130   val typeWithInheritedMembersInjectionVal: TypeWithInheritedMembersInjection
131   val typeWithInheritedMembersInjectionMembersInjectorVal:
132     MembersInjector<TypeWithInheritedMembersInjection>
133 }
134