blob: 20888fd7f02e0b8ec60a64e2c4884a8d7a961ca8 [file] [log] [blame]
Pierre De Rop11527502016-02-18 21:07:16 +00001package org.apache.felix.dm.lambda.callbacks;
2
3import java.util.Objects;
4
5import org.apache.felix.dm.Component;
6
7/**
8 * Represents a callback(Component) on an Object instance.
9 *
10 * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
11 */
12@FunctionalInterface
13public interface InstanceCbComponent {
14 /**
15 * Handles the given argument.
16 * @param component the callback parameter
17 */
18 void accept(Component component);
19
20 default InstanceCbComponent andThen(InstanceCbComponent after) {
21 Objects.requireNonNull(after);
22 return (Component component) -> {
23 accept(component);
24 after.accept(component);
25 };
26 }
27}