2 * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
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
8 package org.opendaylight.mdsal.binding.api.query;
10 import com.google.common.annotations.Beta;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.yangtools.binding.DataObject;
15 * Builder for a match of a leaf value which define a total ordering by implementing the {@link Comparable} interface.
18 * Note that value comparison is preconditioned on target leaf existence. If the leaf does not exist any total ordering
19 * checks will not match it -- thus a non-existent leaf does not match {@link #greaterThan(Comparable)} and at the same
20 * time it does not match {@link #lessThanOrEqual(Comparable)}.
22 * @param <T> query result type
23 * @param <V> value type
26 public interface ComparableMatchBuilder<T extends DataObject, V extends Comparable<V>> extends ValueMatchBuilder<T, V> {
28 * Match if the leaf exists and its value is less than the specified value.
30 * @param value value to check against
31 * @return A ValueMatch
32 * @throws NullPointerException if value is null
34 @NonNull ValueMatch<T> lessThan(V value);
37 * Match if the leaf exists and its value is less than, or equal to, the specified value.
39 * @param value value to check against
40 * @return A ValueMatch
41 * @throws NullPointerException if value is null
43 @NonNull ValueMatch<T> lessThanOrEqual(V value);
46 * Match if the leaf exists and its value is greater than the specified value.
48 * @param value value to check against
49 * @return A ValueMatch
50 * @throws NullPointerException if value is null
52 @NonNull ValueMatch<T> greaterThan(V value);
55 * Match if the leaf exists and its value is greater than, or equal to the specified value.
57 * @param value value to check against
58 * @return A ValueMatch
59 * @throws NullPointerException if value is null
61 @NonNull ValueMatch<T> greaterThanOrEqual(V value);