• 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})
21final class DaggerSimpleComponent {
22  private DaggerSimpleComponent() {
23  }
24
25  public static Builder builder() {
26    return new Builder();
27  }
28
29  public static SimpleComponent create() {
30    return new Builder().build();
31  }
32
33  static final class Builder {
34    private Builder() {
35    }
36
37    public SimpleComponent build() {
38      return new SimpleComponentImpl();
39    }
40  }
41
42  private static final class SimpleComponentImpl implements SimpleComponent {
43    private final SimpleComponentImpl simpleComponentImpl = this;
44
45    private Provider<SomeInjectableType> someInjectableTypeProvider;
46
47    private SimpleComponentImpl() {
48
49      initialize();
50
51    }
52
53    @SuppressWarnings("unchecked")
54    private void initialize() {
55      this.someInjectableTypeProvider = new SwitchingProvider<>(simpleComponentImpl, 0);
56    }
57
58    @Override
59    public SomeInjectableType someInjectableType() {
60      return someInjectableTypeProvider.get();
61    }
62
63    @Override
64    public Lazy<SomeInjectableType> lazySomeInjectableType() {
65      return DoubleCheck.lazy(someInjectableTypeProvider);
66    }
67
68    @Override
69    public javax.inject.Provider<SomeInjectableType> someInjectableTypeProvider() {
70      return someInjectableTypeProvider;
71    }
72
73    private static final class SwitchingProvider<T> implements Provider<T> {
74      private final SimpleComponentImpl simpleComponentImpl;
75
76      private final int id;
77
78      SwitchingProvider(SimpleComponentImpl simpleComponentImpl, int id) {
79        this.simpleComponentImpl = simpleComponentImpl;
80        this.id = id;
81      }
82
83      @SuppressWarnings("unchecked")
84      @Override
85      public T get() {
86        switch (id) {
87          case 0: // test.SomeInjectableType
88          return (T) new SomeInjectableType();
89
90          default: throw new AssertionError(id);
91        }
92      }
93    }
94  }
95}
96
97