1 /* 2 * Copyright (C) 2015 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; 18 19 import javax.inject.Inject; 20 import javax.inject.Provider; 21 22 class GenericParent<X, Y> { 23 24 Provider<X> registeredX; 25 Y registeredY; 26 B registeredB; 27 Parameterized<Y> registerParameterizedOfY; 28 GenericParent()29 @Inject GenericParent() {} 30 31 @Inject Provider<X> x; 32 @Inject Y y; 33 @Inject B b; 34 @Inject Parameterized<X> parameterizedOfX; 35 36 @Inject registerX(Provider<X> x)37 void registerX(Provider<X> x) { 38 this.registeredX = x; 39 } registerY(Y y)40 @Inject void registerY(Y y) { this.registeredY = y; } registerB(B b)41 @Inject void registerB(B b) { this.registeredB = b; } registerParameterizedOfY(Parameterized<Y> parameterizedOfY)42 @Inject void registerParameterizedOfY(Parameterized<Y> parameterizedOfY) { 43 this.registerParameterizedOfY = parameterizedOfY; 44 } 45 46 static class Parameterized<P> { 47 @Inject P p; 48 Parameterized()49 @Inject Parameterized() {} 50 } 51 } 52