FELIX-4689: Create a more fluent syntax for the dependency manager builder.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1727869 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbComponentBundle.java b/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbComponentBundle.java
new file mode 100644
index 0000000..5049a25
--- /dev/null
+++ b/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/CbComponentBundle.java
@@ -0,0 +1,29 @@
+package org.apache.felix.dm.lambda.callbacks;
+
+import java.util.Objects;
+
+import org.apache.felix.dm.Component;
+import org.osgi.framework.Bundle;
+
+/**
+ * Represents a callback(Component, Bundle) on an Object instance.
+ *
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+@FunctionalInterface
+public interface CbComponentBundle {
+ /**
+ * Handles the given arguments.
+ * @param component the callback parameter
+ * @param bundle the callback parameter
+ */
+ void accept(Component component, Bundle bundle);
+
+ default CbComponentBundle andThen(CbComponentBundle after) {
+ Objects.requireNonNull(after);
+ return (Component component, Bundle bundle) -> {
+ accept(component, bundle);
+ after.accept(component, bundle);
+ };
+ }
+}