1 package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.bug._6006.rev160607;
3 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.bug._6006.rev160607.IdentBase;
4 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.bug._6006.rev160607.IdentOne;
5 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.bug._6006.rev160607.IdentTwo;
8 * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
9 * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
11 * The reason behind putting it under src/main/java is:
12 * 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
16 public class UnionTypeBuilder {
18 public static UnionType getDefaultInstance(java.lang.String defaultValue) {
19 Class<? extends IdentBase> identityref = null;
20 if (defaultValue.equals("IdentOne")) {
21 return new UnionType(IdentOne.class);
23 if (defaultValue.equals("IdentTwo")) {
24 return new UnionType(IdentTwo.class);
26 throw new IllegalArgumentException("Unknown UnionType string " + defaultValue);