Merge "Fix checkListKey not checking actual/expected values"
[yangtools.git] / common / concepts / src / main / java / org / opendaylight / yangtools / concepts / Path.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. 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.concepts;
9
10 import javax.annotation.Nonnull;
11
12 /**
13  * Conceptual representation of a logical path in a tree-like structure, similar to a
14  * {@link java.nio.file.Path}, but more general in terms of what objects it can be applied to.
15  * Paths have an equivalence class, which is captured in the defining type. Paths also have the
16  * notion of containment, where one path is said to contain another path if it the data set
17  * identified by the former contains all elements of the data set represented by later.
18  *
19  * @param <P> Path equivalence class
20  */
21 public interface Path<P extends Path<P>> {
22     /**
23      * Check if this path contains some other.
24      *
25      * @param other Other path, may not be null.
26      * @return True if this path contains the other.
27      */
28     boolean contains(@Nonnull P other);
29 }