Populate data/ hierarchy
[yangtools.git] / yang / yang-model-ri / src / main / java / org / opendaylight / yangtools / yang / model / ri / type / InvalidBitDefinitionException.java
1 /*
2  * Copyright (c) 2015 Pantheon Technologies 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.model.ri.type;
9
10 import static java.util.Objects.requireNonNull;
11
12 import com.google.common.annotations.Beta;
13 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
14 import org.opendaylight.yangtools.yang.model.api.type.BitsTypeDefinition.Bit;
15
16 @Beta
17 public class InvalidBitDefinitionException extends IllegalArgumentException {
18     private static final long serialVersionUID = 1L;
19
20     @SuppressFBWarnings("SE_BAD_FIELD")
21     private final Bit offendingBit;
22
23     protected InvalidBitDefinitionException(final Bit offendingBit, final String message) {
24         super(message);
25         this.offendingBit = requireNonNull(offendingBit);
26     }
27
28     public InvalidBitDefinitionException(final Bit offendingBit, final String format,
29             final Object... args) {
30         this(offendingBit, String.format(format, args));
31     }
32
33     public Bit getOffendingBit() {
34         return offendingBit;
35     }
36 }