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