blob: 6f60523e5f06e6012fb989e25e86746c320262c6 [file] [log] [blame]
Pierre De Rop11527502016-02-18 21:07:16 +00001package org.apache.felix.dm.lambda.callbacks;
2
3import java.util.Objects;
4
5/**
6 * Represents a reference to a callback on an Object instance that takes Configuration type as argument.
7 * For more informations about configuration type, please refer to {@link CbConfiguration}.
8 *
9 * <p> The T generic parameter represents the type of the configuration class passed to the callback argument.
10 *
11 * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
12 */
13@FunctionalInterface
14public interface InstanceCbConfiguration<T> extends SerializableLambda {
15 /**
16 * Handles the given argument.
17 * @param configType the configuration type
18 */
19 void accept(T configType);
20
21 default InstanceCbConfiguration<T> andThen(InstanceCbConfiguration<T> after) {
22 Objects.requireNonNull(after);
23 return (T configProxy) -> {
24 accept(configProxy);
25 after.accept(configProxy);
26 };
27 }
28}