/* * Copyright (C) 2015 The Dagger Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package dagger.functional.cycle; import dagger.Binds; import dagger.Component; import dagger.Lazy; import dagger.Module; import dagger.Provides; import dagger.Subcomponent; import dagger.multibindings.IntoMap; import dagger.multibindings.StringKey; import java.util.Map; import javax.inject.Inject; import javax.inject.Provider; /** * Cycle classes used for testing cyclic dependencies. * *
* {@literal A ← (E ← D ← B ← C ← Provider, Lazy), (B ← C ← Provider, Lazy)}
* {@literal S ← Provider, Lazy}
*
*/
final class Cycles {
private Cycles() {}
static class A {
public final B b;
public final E e;
@Inject
A(E e, B b) {
this.e = e;
this.b = b;
}
}
static class B {
public final C c;
@Inject
B(C c) {
this.c = c;
}
}
static class C {
public final Provider aProvider;
@Inject public Lazy aLazy;
@Inject public Provider