Code clean up
[bgpcep.git] / pcep / topology / topology-provider / src / main / java / org / opendaylight / bgpcep / pcep / topology / provider / OperationResults.java
index 05082474343906596deb6ebd1e0d10d780d18dfb..a8e6a0a9c2762a8d89016b87e6b3d5efffd9d91a 100644 (file)
@@ -13,6 +13,7 @@ import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import java.util.Collections;
 import java.util.List;
+import java.util.stream.Collectors;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcep.error.object.ErrorObjectBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcerr.message.pcerr.message.Errors;
@@ -55,7 +56,8 @@ final class OperationResults implements OperationResult {
     public static OperationResults createUnsent(final PCEPErrors error) {
         final List<Errors> e = error != null ? Collections.singletonList(getErrorFor(error))
                 : Collections.emptyList();
-        return new OperationResults(FailureType.Unsent, Lists.transform(e, CONVERT_ERRORS));
+        return new OperationResults(FailureType.Unsent, e.stream().map(CONVERT_ERRORS::apply)
+                .collect(Collectors.toList()));
     }
 
     private static Errors getErrorFor(final PCEPErrors error) {