use of org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.ProcessFlatBatchOutput in project openflowplugin by opendaylight.
the class FlatBatchMeterAdapters method convertBatchMeterResult.
/**
* Convert meter batch result.
* @param stepOffset offset of current batch plan step
* @return converted {@link ProcessFlatBatchOutput} RPC result
*/
@VisibleForTesting
static <T extends BatchMeterOutputListGrouping> Function<RpcResult<T>, RpcResult<ProcessFlatBatchOutput>> convertBatchMeterResult(final int stepOffset) {
return new Function<RpcResult<T>, RpcResult<ProcessFlatBatchOutput>>() {
@Nullable
@Override
public RpcResult<ProcessFlatBatchOutput> apply(@Nonnull final RpcResult<T> input) {
List<BatchFailure> batchFailures = wrapBatchMeterFailuresForFlat(input, stepOffset);
ProcessFlatBatchOutputBuilder outputBuilder = new ProcessFlatBatchOutputBuilder().setBatchFailure(batchFailures);
return RpcResultBuilder.<ProcessFlatBatchOutput>status(input.isSuccessful()).withRpcErrors(input.getErrors()).withResult(outputBuilder.build()).build();
}
};
}
Aggregations