1 /* 2 * Copyright (C) 2016 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.builderbinds; 18 19 import dagger.BindsInstance; 20 import dagger.Component; 21 import java.util.List; 22 import javax.inject.Named; 23 24 @Component 25 interface TestComponent { count()26 int count(); 27 l()28 long l(); 29 30 @Named("input") input()31 String input(); 32 33 @Nullable 34 @Named("nullable input") nullableInput()35 String nullableInput(); 36 listOfString()37 List<String> listOfString(); 38 39 @Named("subtype") boundInSubtype()40 int boundInSubtype(); 41 42 @Component.Builder 43 interface Builder extends BuilderSupertype { 44 @BindsInstance count(int count)45 Builder count(int count); 46 47 @BindsInstance l(long l)48 Builder l(long l); 49 50 @BindsInstance input(@amed"input") String input)51 Builder input(@Named("input") String input); 52 53 @BindsInstance nullableInput(@ullable @amed"nullable input") String nullableInput)54 Builder nullableInput(@Nullable @Named("nullable input") String nullableInput); 55 56 @BindsInstance listOfString(List<String> listOfString)57 Builder listOfString(List<String> listOfString); 58 build()59 TestComponent build(); 60 } 61 } 62