package test; import dagger.internal.DaggerGenerated; import dagger.internal.InstanceFactory; import dagger.internal.Provider; import java.util.Optional; import javax.annotation.processing.Generated; @DaggerGenerated @Generated( value = "dagger.internal.codegen.ComponentProcessor", comments = "https://dagger.dev" ) @SuppressWarnings({ "unchecked", "rawtypes", "KotlinInternal", "KotlinInternalInJava", "cast" }) final class DaggerTestComponent { /** * A {@link Provider} that returns {@code Optional.empty()}. */ @SuppressWarnings("rawtypes") private static final Provider ABSENT_JDK_OPTIONAL_PROVIDER = InstanceFactory.create(Optional.empty()); private DaggerTestComponent() { } public static Builder builder() { return new Builder(); } public static TestComponent create() { return new Builder().build(); } /** * Returns a {@link Provider} that returns {@code Optional.empty()}. */ private static Provider> absentJdkOptionalProvider() { @SuppressWarnings("unchecked") // safe covariant cast Provider> provider = (Provider>) ABSENT_JDK_OPTIONAL_PROVIDER; return provider; } static final class Builder { private Builder() { } public TestComponent build() { return new TestComponentImpl(); } } private static final class TestComponentImpl implements TestComponent { private final TestComponentImpl testComponentImpl = this; private Provider> optionalOfPresentProvider; private Provider> optionalOfAbsentProvider; private TestComponentImpl() { initialize(); } @SuppressWarnings("unchecked") private void initialize() { this.optionalOfPresentProvider = new SwitchingProvider<>(testComponentImpl, 0); this.optionalOfAbsentProvider = absentJdkOptionalProvider(); } @Override public javax.inject.Provider> providerOfOptionalOfPresent() { return optionalOfPresentProvider; } @Override public javax.inject.Provider> providerOfOptionalOfAbsent() { return optionalOfAbsentProvider; } private static final class SwitchingProvider implements Provider { private final TestComponentImpl testComponentImpl; private final int id; SwitchingProvider(TestComponentImpl testComponentImpl, int id) { this.testComponentImpl = testComponentImpl; this.id = id; } @SuppressWarnings("unchecked") @Override public T get() { switch (id) { case 0: // java.util.Optional return (T) Optional.of(TestModule_PFactory.p()); default: throw new AssertionError(id); } } } } }