blob: ea54a102855062d1ccaf4376fddeb48fdaba0d7f [file] [log] [blame]
package org.apache.felix.dm.lambda.callbacks;
import java.util.Objects;
import org.apache.felix.dm.Component;
/**
* Represents a callback(Component) invoked on an Object instance.
*
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
@FunctionalInterface
public interface InstanceCbComponent {
/**
* Handles the given argument.
* @param component the callback parameter
*/
void accept(Component component);
default InstanceCbComponent andThen(InstanceCbComponent after) {
Objects.requireNonNull(after);
return (Component component) -> {
accept(component);
after.accept(component);
};
}
}