Populate parser/ hierarchy
[yangtools.git] / parser / yang-parser-spi / src / main / java / org / opendaylight / yangtools / yang / parser / spi / meta / CopyType.java
1 /*
2  * Copyright (c) 2016 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.parser.spi.meta;
9
10 import com.google.common.annotations.Beta;
11 import com.google.common.base.Verify;
12
13 @Beta
14 public enum CopyType {
15     ORIGINAL,
16     ADDED_BY_USES,
17     ADDED_BY_AUGMENTATION,
18     ADDED_BY_USES_AUGMENTATION;
19
20     private final int bit;
21
22     CopyType() {
23         // CopyHistory relies on the fact that the result fits into a short
24         Verify.verify(ordinal() < Short.SIZE);
25         bit = 1 << ordinal();
26     }
27
28     int bit() {
29         return bit;
30     }
31 }