Pierre De Rop | 1152750 | 2016-02-18 21:07:16 +0000 | [diff] [blame] | 1 | package org.apache.felix.dm.lambda.callbacks; |
| 2 | |
| 3 | import java.util.Dictionary; |
| 4 | import java.util.Objects; |
| 5 | |
| 6 | /** |
| 7 | * Represents a callback(Dictionary) on an Object instance. |
| 8 | * |
| 9 | * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a> |
| 10 | */ |
| 11 | @FunctionalInterface |
| 12 | public interface InstanceCbDictionary { |
| 13 | /** |
| 14 | * Handles the given argument. |
| 15 | * @param conf the properties |
| 16 | */ |
| 17 | void accept(Dictionary<String, Object> conf); |
| 18 | |
| 19 | default InstanceCbDictionary andThen(InstanceCbDictionary after) { |
| 20 | Objects.requireNonNull(after); |
| 21 | return (Dictionary<String, Object> conf) -> { |
| 22 | accept(conf); |
| 23 | after.accept(conf); |
| 24 | }; |
| 25 | } |
| 26 | } |