Add YangFeatureProvider
[mdsal.git] / binding / yang-binding / src / main / java / org / opendaylight / yangtools / yang / binding / YangFeatureProvider.java
1 /*
2  * Copyright (c) 2022 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.yangtools.yang.binding;
9
10 import java.util.ServiceLoader;
11 import java.util.Set;
12 import org.eclipse.jdt.annotation.NonNullByDefault;
13
14 /**
15  * Run-time feature discovery service. Implementations of this interface are required to be registered with the
16  * {@link ServiceLoader} framework.
17  */
18 @NonNullByDefault
19 public interface YangFeatureProvider<R extends DataRoot> {
20     /**
21      * Return the module this provider recognizes. It is implied that any feature defined in this module and not
22      * advertized by any provider is unavailable.
23      *
24      * @return {@link DataRoot} class this provider binds to
25      */
26     Class<R> boundModule();
27
28     /**
29      * Return the set of supported features.
30      *
31      * @return Supported features.
32      */
33     Set<? extends YangFeature<?, R>> supportedFeatures();
34 }