Add simple data listeners
[mdsal.git] / binding / mdsal-binding-api / src / main / java / org / opendaylight / mdsal / binding / api / DataListener.java
1 /*
2  * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.mdsal.binding.api;
9
10 import com.google.common.annotations.Beta;
11 import org.eclipse.jdt.annotation.Nullable;
12 import org.opendaylight.yangtools.yang.binding.DataObject;
13
14 /**
15  * Interface implemented by classes interested in receiving the last data change.
16  */
17 @Beta
18 @FunctionalInterface
19 public interface DataListener<T extends DataObject> {
20
21     /**
22      * Invoked when there was data change for the supplied path, which was used to register listener.
23      * @param data last state.
24      */
25     void dataChangedTo(@Nullable T data);
26 }