Introduce odl-bytebuddy
[yangtools.git] / binding / binding-lib / src / main / java / org / opendaylight / yangtools / yang / binding / BitsTypeObject.java
1 /*
2  * Copyright (c) 2022 PANTHEON.tech, s.r.o. 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.binding;
9
10 import com.google.common.collect.ImmutableSet;
11 import org.eclipse.jdt.annotation.NonNull;
12
13 /**
14  * Interface implemented by all {@link TypeObject}s generated for {@code type bits}.
15  */
16 public non-sealed interface BitsTypeObject extends TypeObject {
17     /**
18      * Return the set of strings which are valid {@code bit} names for this type. The iteration order of the returned
19      * set is required to match effective bit {@code position} assignment.
20      *
21      * @return The names of valid bits for this type.
22      */
23     @NonNull ImmutableSet<String> validNames();
24
25     /**
26      * Return the bit values. Returned array contains all bits from {@link #validNames()} in the interation order of
27      * that set. Note that the array is packed, e.g. unassigned positions are skipped over.
28      *
29      * @return Array of values.
30      */
31     boolean @NonNull [] values();
32 }