@Test public void testCaseSelectorThrows() { Observable<Integer> source1 = Observable.from(1, 2, 3); Map<Integer, Observable<Integer>> map = new HashMap<Integer, Observable<Integer>>(); map.put(1, source1); Observable<Integer> result = Statement.switchCase(funcError, map); observe(result, 1, 2, 3); observeError(result, RuntimeException.class); }
public static <K, R> OnSubscribeFunc<R> switchCase( Func0<? extends K> caseSelector, Map<? super K, ? extends Observable<? extends R>> mapOfCases, Observable<? extends R> defaultCase) { return new SwitchCase<K, R>(caseSelector, mapOfCases, defaultCase); }
OperationConditionals { public static <K, R> OnSubscribeFunc<R> switchCase( Func0<? extends K> caseSelector, Map<? super K, ? extends Observable<? extends R>> mapOfCases, Observable<? extends R> defaultCase) { return new SwitchCase<K, R>(caseSelector, mapOfCases, defaultCase); } }
OperationConditionals { public static <K, R> OnSubscribeFunc<R> switchCase( Func0<? extends K> caseSelector, Map<? super K, ? extends Observable<? extends R>> mapOfCases, Observable<? extends R> defaultCase) { return new SwitchCase<K, R>(caseSelector, mapOfCases, defaultCase); } private  OperationConditionals(); }
OperationConditionals { public static <K, R> OnSubscribeFunc<R> switchCase( Func0<? extends K> caseSelector, Map<? super K, ? extends Observable<? extends R>> mapOfCases, Observable<? extends R> defaultCase) { return new SwitchCase<K, R>(caseSelector, mapOfCases, defaultCase); } private  OperationConditionals(); static OnSubscribeFunc<R> switchCase(
            Func0<? extends K> caseSelector,
            Map<? super K, ? extends Observable<? extends R>> mapOfCases,
            Observable<? extends R> defaultCase); static OnSubscribeFunc<R> ifThen(
            Func0<Boolean> condition,
            Observable<? extends R> then,
            Observable<? extends R> orElse); static OnSubscribeFunc<T> doWhile(Observable<? extends T> source, Func0<Boolean> postCondition); static OnSubscribeFunc<T> whileDo(Observable<? extends T> source, Func0<Boolean> preCondition); }
OperationConditionals { public static <K, R> OnSubscribeFunc<R> switchCase( Func0<? extends K> caseSelector, Map<? super K, ? extends Observable<? extends R>> mapOfCases, Observable<? extends R> defaultCase) { return new SwitchCase<K, R>(caseSelector, mapOfCases, defaultCase); } private  OperationConditionals(); static OnSubscribeFunc<R> switchCase(
            Func0<? extends K> caseSelector,
            Map<? super K, ? extends Observable<? extends R>> mapOfCases,
            Observable<? extends R> defaultCase); static OnSubscribeFunc<R> ifThen(
            Func0<Boolean> condition,
            Observable<? extends R> then,
            Observable<? extends R> orElse); static OnSubscribeFunc<T> doWhile(Observable<? extends T> source, Func0<Boolean> postCondition); static OnSubscribeFunc<T> whileDo(Observable<? extends T> source, Func0<Boolean> preCondition);  }