• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1package test;
2
3import dagger.Lazy;
4import dagger.internal.DaggerGenerated;
5import dagger.internal.DoubleCheck;
6import dagger.internal.Provider;
7import javax.annotation.processing.Generated;
8
9@DaggerGenerated
10@Generated(
11    value = "dagger.internal.codegen.ComponentProcessor",
12    comments = "https://dagger.dev"
13)
14@SuppressWarnings({
15    "unchecked",
16    "rawtypes",
17    "KotlinInternal",
18    "KotlinInternalInJava",
19    "cast",
20    "deprecation",
21    "nullness:initialization.field.uninitialized"
22})
23final class DaggerSimpleComponent {
24  private DaggerSimpleComponent() {
25  }
26
27  public static Builder builder() {
28    return new Builder();
29  }
30
31  public static SimpleComponent create() {
32    return new Builder().build();
33  }
34
35  static final class Builder {
36    private Builder() {
37    }
38
39    public SimpleComponent build() {
40      return new SimpleComponentImpl();
41    }
42  }
43
44  private static final class SimpleComponentImpl implements SimpleComponent {
45    private final SimpleComponentImpl simpleComponentImpl = this;
46
47    private Provider<SomeInjectableType> someInjectableTypeProvider;
48
49    private SimpleComponentImpl() {
50
51      initialize();
52
53    }
54
55    @SuppressWarnings("unchecked")
56    private void initialize() {
57      this.someInjectableTypeProvider = new SwitchingProvider<>(simpleComponentImpl, 0);
58    }
59
60    @Override
61    public SomeInjectableType someInjectableType() {
62      return someInjectableTypeProvider.get();
63    }
64
65    @Override
66    public Lazy<SomeInjectableType> lazySomeInjectableType() {
67      return DoubleCheck.lazy(someInjectableTypeProvider);
68    }
69
70    @Override
71    public javax.inject.Provider<SomeInjectableType> someInjectableTypeProvider() {
72      return someInjectableTypeProvider;
73    }
74
75    private static final class SwitchingProvider<T> implements Provider<T> {
76      private final SimpleComponentImpl simpleComponentImpl;
77
78      private final int id;
79
80      SwitchingProvider(SimpleComponentImpl simpleComponentImpl, int id) {
81        this.simpleComponentImpl = simpleComponentImpl;
82        this.id = id;
83      }
84
85      @SuppressWarnings("unchecked")
86      @Override
87      public T get() {
88        switch (id) {
89          case 0: // test.SomeInjectableType
90          return (T) new SomeInjectableType();
91
92          default: throw new AssertionError(id);
93        }
94      }
95    }
96  }
97}
98
99