a066b7cf9afff3bbf8447c8828ee7b538948fe24
[yangtools.git] / data / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / schema / OrderedNodeContainer.java
1 /*
2  * Copyright (c) 2014 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.yang.data.api.schema;
9
10 import org.eclipse.jdt.annotation.NonNull;
11 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
12
13 /**
14  * A {@link NormalizedNodeContainer} which preserves user supplied ordering and allows addressing of child elements by
15  * position. All implementations of this interface must also implement {@link OrderingAware.User}.
16  *
17  * @param <V> child type
18  */
19 // FIXME: 8.0.0: we really want to do a List<@NonNull V> body(), but need to reconcile that with key-based lookup in
20 //               implementations -- and those are using only a Map internally.
21 public interface OrderedNodeContainer<V extends NormalizedNode>
22         extends NormalizedNodeContainer<V>, MixinNode, OrderingAware.User {
23     @Override
24     NodeIdentifier getIdentifier();
25
26     /**
27      * Returns child node by position.
28      *
29      * @param position Position of child node
30      * @return Child Node
31      * @throws IndexOutOfBoundsException Out of bound Exception
32      */
33     @NonNull V childAt(int position);
34
35     @Override
36     int hashCode();
37
38     @Override
39     boolean equals(Object obj);
40 }