blob: 20888fd7f02e0b8ec60a64e2c4884a8d7a961ca8 [file] [log] [blame]
package org.apache.felix.dm.lambda.callbacks;
import java.util.Objects;
import org.apache.felix.dm.Component;
/**
* Represents a callback(Component) 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);
};
}
}