Add a simple Binding query language
[mdsal.git] / binding / mdsal-binding-api / src / main / java / org / opendaylight / mdsal / binding / api / query / ValueMatchBuilder.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
14 /**
15  * Basic builder for a match of a leaf value.
16  *
17  * @param <T> query result type
18  * @param <V> value type
19  */
20 @Beta
21 public interface ValueMatchBuilder<T extends DataObject, V> {
22     /**
23      * Match any existing value.
24      *
25      * @return A ValueMatch
26      */
27     @NonNull ValueMatch<T> nonNull();
28
29     /**
30      * Match exact value.
31      *
32      * @param value value to match
33      * @return A ValueMatch
34      * @throws NullPointerException if value is null
35      */
36     @NonNull ValueMatch<T> valueEquals(@NonNull V value);
37 }