eb680186053164a3cc9af2741e1a931453a31357
[netconf.git] / netconf / models / ietf-netconf-nmda / src / main / java / org / opendaylight / yang / gen / v1 / urn / ietf / params / xml / ns / yang / ietf / netconf / nmda / rev190107 / GetDataInputMaxDepthBuilder.java
1 /*
2  * Copyright (c) 2019 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.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.nmda.rev190107;
9
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;
14
15 /**
16  * MaxDepth utilities.
17  */
18 public final class GetDataInputMaxDepthBuilder {
19     private GetDataInputMaxDepthBuilder() {
20         // Exists only to defeat instantiation.
21     }
22
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());
27         }
28         // FIXME: consider being stricter about number formats here
29         return new MaxDepth(Uint16.valueOf(defaultValue));
30     }
31 }