Due to I haven't got a lot of information about your project and concrete implementation of methods, namely their arguments and return types, I have 2 assumtions.
Note: I hope you don't mind if I'll use lambda-expressions.
1). Methods return Observable<Object> like Retrofit
In this case, they looks like this:
public Observable<Object> methodA(Object o){
return null;
}
public Observable<Object> methodB(Object o){
return null;
}
public Observable<Object> methodC(Object[] objects){
return null;
}
For this case you may use something like this:
Object[] localDBObjects = new Object[10];
Observable.just(localDBObjects)
.flatMap(objects -> Observable.from(objects)
.flatMap(object -> methodA(object))
.flatMap(resultFromMethodA -> methodB(resultFromMethodA))
.toList())
.flatMap(listOfResultsFromMethodB -> methodC(listOfResultsFromMethodB.toArray(new Object[listOfResultsFromMethodB.size()])))
.subscribe(resultFromMethodC -> {
//do something
}, t -> t.printStackTrace());
2). In other case, ,methods return the Object like this:
public Object methodA(Object o){
return null;
}
public Object methodB(Object o){
return null;
}
public Object methodC(Object[] objects){
return null;
}
In this case you need to change operators flatMap( ) to map( ) in some places:
Object[] localDBObjects = new Object[10];
Observable.just(localDBObjects)
.flatMap(objects -> Observable.from(objects)
.map(object -> methodA(object))
.map(resultFromMethodA -> methodB(resultFromMethodA))
.toList())
.map(listOfResultsFromMethodB -> methodC(listOfResultsFromMethodB.toArray(new Object[listOfResultsFromMethodB.size()])))
.subscribe(resultFromMethodC -> {
//do something
}, t -> t.printStackTrace());