public static <I, O> Observable.Transformer<I, O> toTransformer( final Connectable<I, O> connectable) { return toTransformer(connectable, BackpressureMode.NONE); } }
/** * Create an {@link SubtypeEffectHandlerBuilder} for handling effects based on their type. * * @param <F> the effect type * @param <E> the event type */ public static <F, E> SubtypeEffectHandlerBuilder<F, E> subtypeEffectHandler() { return new SubtypeEffectHandlerBuilder<>(); }
static <T, R> FlatMapCompletable<T, R> create(Func1<T, Completable> func) { return create(func, null); }
@Test public void shouldReportEffectClassCollisionWhenAddingSubclass() throws Exception { RxMobius.SubtypeEffectHandlerBuilder<TestEffect, TestEvent> builder = RxMobius.<TestEffect, TestEvent>subtypeEffectHandler() .addTransformer(Parent.class, observable -> null); thrown.expect(IllegalArgumentException.class); thrown.expectMessage("collision"); builder.addTransformer(Child.class, observable -> null); }
/** * Creates a {@link Transformer} that will flatten the provided {@link Action0} into the stream as * a {@link Completable} every time it receives an effect from the upstream effects observable. * This will result in calling the provided Action every time an effect is dispatched to the * created transformer. * * @param doEffect {@link Action0} to be run every time the effect is requested * @param <F> the type of Effect this transformer handles * @param <E> these transformers are for effects that do not result in any events; however, they * still need to share the same Event type * @return a {@link Transformer} that can be used with an {@link SubtypeEffectHandlerBuilder} */ static <F, E> Transformer<F, E> fromAction(final Action0 doEffect) { return fromAction(doEffect, null); }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof MobiusEffectRouterTest.A) { MobiusEffectRouterTest.A that = (MobiusEffectRouterTest.A) o; return (this.id == that.id()); } return false; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof MobiusEffectRouterTest.E) { MobiusEffectRouterTest.E that = (MobiusEffectRouterTest.E) o; return (this.id == that.id()); } return false; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof MobiusEffectRouterTest.C) { MobiusEffectRouterTest.C that = (MobiusEffectRouterTest.C) o; return (this.id == that.id()); } return false; }
static B create(int id) { return new AutoValue_MobiusEffectRouterTest_B(id); } }
static D create(int id) { return new AutoValue_MobiusEffectRouterTest_D(id); } }
static C create(int id) { return new AutoValue_MobiusEffectRouterTest_C(id); } }
static Unhandled create() { return new AutoValue_MobiusEffectRouterTest_Unhandled(); } }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof MobiusEffectRouterTest.BEvent) { MobiusEffectRouterTest.BEvent that = (MobiusEffectRouterTest.BEvent) o; return (this.id == that.id()); } return false; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof MobiusEffectRouterTest.D) { MobiusEffectRouterTest.D that = (MobiusEffectRouterTest.D) o; return (this.id == that.id()); } return false; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof MobiusEffectRouterTest.AEvent) { MobiusEffectRouterTest.AEvent that = (MobiusEffectRouterTest.AEvent) o; return (this.id == that.id()); } return false; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof MobiusEffectRouterTest.B) { MobiusEffectRouterTest.B that = (MobiusEffectRouterTest.B) o; return (this.id == that.id()); } return false; }
static AEvent create(int id) { return new AutoValue_MobiusEffectRouterTest_AEvent(id); } }
static A create(int id) { return new AutoValue_MobiusEffectRouterTest_A(id); } }
static E create(int id) { return new AutoValue_MobiusEffectRouterTest_E(id); } }
static BEvent create(int id) { return new AutoValue_MobiusEffectRouterTest_BEvent(id); } }