Use YANG binding from YANG Tools
[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.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 when non-existent.
31      *
32      * @return A ValueMatch
33      */
34     @NonNull ValueMatch<T> isNull();
35
36     /**
37      * Match exact value.
38      *
39      * @param value value to match
40      * @return A ValueMatch
41      * @throws NullPointerException if value is null
42      */
43     @NonNull ValueMatch<T> valueEquals(@NonNull V value);
44 }