BUG-6316: Fix Bit and EnumPair's position/value types
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / type / BitsTypeDefinition.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.yang.model.api.type;
9
10 import java.util.List;
11 import javax.annotation.Nonnull;
12 import org.opendaylight.yangtools.yang.model.api.SchemaNode;
13 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
14
15 /**
16  * Makes is possible to access to the individual bits values of this type.
17  */
18 public interface BitsTypeDefinition extends TypeDefinition<BitsTypeDefinition> {
19     /**
20      * Returns all bit values.
21      *
22      * @return list of <code>Bit</code> type instastances with data about all
23      *         individual bits of <code>bits</code> YANG built-in type
24      */
25     @Nonnull List<Bit> getBits();
26
27     /**
28      *
29      * Contains the methods for accessing the data about the individual bit of
30      * <code>bits</code> YANG type.
31      */
32     interface Bit extends SchemaNode {
33         /**
34          * Returns the name of the concrete bit.
35          *
36          * @return string with the name of the concrete bit
37          */
38         @Nonnull String getName();
39
40         /**
41          * The position value MUST be in the range 0 to 4294967295, and it MUST
42          * be unique within the bits type.
43          *
44          * @return The position value of bit in range from 0 to 4294967295.
45          */
46         long getPosition();
47     }
48 }