- return Futures.transform( combinedFutures,
- new AsyncFunction<List<RpcResult<Void>>,RpcResult<Void>>() {
- @Override
- public ListenableFuture<RpcResult<Void>> apply( List<RpcResult<Void>> results )
- throws Exception {
- boolean atLeastOneSucceeded = false;
- Builder<RpcError> errorList = ImmutableList.builder();
- for( RpcResult<Void> result: results ) {
- if( result.isSuccessful() ) {
- atLeastOneSucceeded = true;
- }
-
- if( result.getErrors() != null ) {
- errorList.addAll( result.getErrors() );
- }
- }
-
- return Futures.immediateFuture(
- RpcResultBuilder.<Void> status( atLeastOneSucceeded )
- .withRpcErrors( errorList.build() ).build() );
+ return Futures.transformAsync(combinedFutures, results -> {
+ boolean atLeastOneSucceeded = false;
+ Builder<RpcError> errorList = ImmutableList.builder();
+ for (RpcResult<? extends Object> result : results) {
+ if (result.isSuccessful()) {
+ atLeastOneSucceeded = true;