2 * Copyright (c) 2015 Pantheon Technologies 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.util.type;
10 import static java.util.Objects.requireNonNull;
12 import org.opendaylight.yangtools.yang.common.QName;
13 import org.opendaylight.yangtools.yang.model.api.type.InstanceIdentifierTypeDefinition;
15 public final class InstanceIdentifierTypeBuilder
16 extends RequireInstanceRestrictedTypeBuilder<InstanceIdentifierTypeDefinition> {
17 InstanceIdentifierTypeBuilder(final InstanceIdentifierTypeDefinition baseType, final QName qname) {
18 super(requireNonNull(baseType), qname);
22 InstanceIdentifierTypeDefinition buildType() {
23 final InstanceIdentifierTypeDefinition base = getBaseType();
24 if (getRequireInstance() == base.requireInstance()) {
28 return new RestrictedInstanceIdentifierType(base, getQName(), getUnknownSchemaNodes(), getRequireInstance());