2 * Copyright (c) 2019 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.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.nmda.rev190107;
10 import java.util.Optional;
11 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.nmda.rev190107.GetDataInput.MaxDepth;
12 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.nmda.rev190107.GetDataInput.MaxDepth.Enumeration;
13 import org.opendaylight.yangtools.yang.common.Uint16;
18 public final class GetDataInputMaxDepthBuilder {
19 private GetDataInputMaxDepthBuilder() {
20 // Exists only to defeat instantiation.
23 public static MaxDepth getDefaultInstance(final String defaultValue) {
24 final Optional<Enumeration> optEnum = Enumeration.forName(defaultValue);
25 if (optEnum.isPresent()) {
26 return new MaxDepth(optEnum.get());
28 // FIXME: consider being stricter about number formats here
29 return new MaxDepth(Uint16.valueOf(defaultValue));