1 /* 2 * Copyright 2016 Google LLC 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 package tests; 17 18 import javax.annotation.processing.Generated; 19 import javax.inject.Inject; 20 import javax.inject.Provider; 21 22 @Generated( 23 value = "com.google.auto.factory.processor.AutoFactoryProcessor", 24 comments = "https://github.com/google/auto/tree/master/factory" 25 ) 26 final class MultipleFactoriesConflictingParameterNamesFactory { 27 28 private final Provider<String> stringProvider; 29 private final Provider<Object> java_lang_ObjectProvider; 30 private final Provider<String> stringProvider2; 31 private final Provider<Object> _tests_AQualifier_java_lang_ObjectProvider; 32 33 @Inject MultipleFactoriesConflictingParameterNamesFactory( Provider<String> stringProvider, Provider<Object> java_lang_ObjectProvider, @AQualifier Provider<String> stringProvider2, @AQualifier Provider<Object> _tests_AQualifier_java_lang_ObjectProvider)34 MultipleFactoriesConflictingParameterNamesFactory( 35 Provider<String> stringProvider, 36 Provider<Object> java_lang_ObjectProvider, 37 @AQualifier Provider<String> stringProvider2, 38 @AQualifier Provider<Object> _tests_AQualifier_java_lang_ObjectProvider) { 39 this.stringProvider = checkNotNull(stringProvider, 1); 40 this.java_lang_ObjectProvider = checkNotNull(java_lang_ObjectProvider, 2); 41 this.stringProvider2 = checkNotNull(stringProvider2, 3); 42 this._tests_AQualifier_java_lang_ObjectProvider = 43 checkNotNull(_tests_AQualifier_java_lang_ObjectProvider, 4); 44 } 45 create(Object unused)46 MultipleFactoriesConflictingParameterNames create(Object unused) { 47 return new MultipleFactoriesConflictingParameterNames( 48 checkNotNull(stringProvider.get(), 1), 49 checkNotNull(java_lang_ObjectProvider.get(), 2), 50 java_lang_ObjectProvider, 51 checkNotNull(unused, 4)); 52 } 53 create()54 MultipleFactoriesConflictingParameterNames create() { 55 return new MultipleFactoriesConflictingParameterNames( 56 checkNotNull(stringProvider2.get(), 1), 57 checkNotNull(_tests_AQualifier_java_lang_ObjectProvider.get(), 2), 58 _tests_AQualifier_java_lang_ObjectProvider); 59 } 60 checkNotNull(T reference, int argumentIndex)61 private static <T> T checkNotNull(T reference, int argumentIndex) { 62 if (reference == null) { 63 throw new NullPointerException( 64 "@AutoFactory method argument is null but is not marked @Nullable. Argument index: " 65 + argumentIndex); 66 } 67 return reference; 68 } 69 } 70