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.model.api.SchemaPath;
13 import org.opendaylight.yangtools.yang.model.api.type.InstanceIdentifierTypeDefinition;
15 public final class InstanceIdentifierTypeBuilder
16 extends RequireInstanceRestrictedTypeBuilder<InstanceIdentifierTypeDefinition> {
18 InstanceIdentifierTypeBuilder(final InstanceIdentifierTypeDefinition baseType,
19 final SchemaPath path) {
20 super(requireNonNull(baseType), path);
24 InstanceIdentifierTypeDefinition buildType() {
25 final InstanceIdentifierTypeDefinition base = getBaseType();
26 if (getRequireInstance() == base.requireInstance()) {
30 return new RestrictedInstanceIdentifierType(base, getPath(), getUnknownSchemaNodes(), getRequireInstance());