1 package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.bug._6006.rev160607;
4 * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
5 * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
7 * The reason behind putting it under src/main/java is:
8 * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent
12 public class UnionTypeBuilder {
14 public static UnionType getDefaultInstance(final java.lang.String defaultValue) {
15 if (defaultValue.equals("IdentOne")) {
16 return new UnionType(IdentOne.class);
18 if (defaultValue.equals("IdentTwo")) {
19 return new UnionType(IdentTwo.class);
23 return new UnionType(Short.valueOf(defaultValue));
24 } catch (NumberFormatException e) {
28 throw new IllegalArgumentException("Unknown UnionType string " + defaultValue);