Add a simple Binding query language
[mdsal.git] / binding / mdsal-binding-api / src / main / java / org / opendaylight / mdsal / binding / api / query / QueryFactory.java
1 /*
2  * Copyright (c) 2020 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.query;
9
10 import com.google.common.annotations.Beta;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.yangtools.yang.binding.DataObject;
13 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
14
15 /**
16  * Primary entry point to creating {@link QueryExpression} instances.
17  */
18 @Beta
19 public interface QueryFactory {
20     /**
21      * Create a new {@link DescendantQueryBuilder} for a specified root path. Root path must be a non-wildcard
22      * InstanceIdentifier in general sense. If the target type represents a list, the last path argument may be a
23      * wildcard, in which case the path is interpreted to search the specified list. Inner path elements have to be
24      * always non-wildcarded.
25      *
26      * @param <T> Target object type
27      * @param rootPath Subtree root
28      * @return a subtree query instance
29      * @throws IllegalArgumentException if rootPath is incorrect
30      * @throws NullPointerException if rootPath is null
31      */
32     <T extends DataObject> @NonNull DescendantQueryBuilder<T> querySubtree(InstanceIdentifier<T> rootPath);
33 }