2 * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
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
8 package org.opendaylight.yangtools.yang.model.ri.stmt.impl.decl;
10 import org.eclipse.jdt.annotation.NonNull;
11 import org.opendaylight.yangtools.yang.model.api.stmt.FractionDigitsStatement;
12 import org.opendaylight.yangtools.yang.model.spi.meta.AbstractDeclaredStatement.ArgumentToString;
14 public final class EmptyFractionDigitsStatement extends ArgumentToString<Integer> implements FractionDigitsStatement {
15 private static final @NonNull EmptyFractionDigitsStatement[] INSTANCES;
18 final EmptyFractionDigitsStatement[] inst = new EmptyFractionDigitsStatement[18];
19 for (int i = 0; i < 18; ++i) {
20 inst[i] = new EmptyFractionDigitsStatement(i + 1);
25 private EmptyFractionDigitsStatement(final int argument) {
29 public static @NonNull EmptyFractionDigitsStatement of(final int argument) {
31 return INSTANCES[argument - 1];
32 } catch (IndexOutOfBoundsException e) {
33 throw new IllegalArgumentException("Invalid fraction-digits argument " + argument, e);