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.ri.type;
10 import java.util.Collection;
11 import org.opendaylight.yangtools.yang.common.QName;
12 import org.opendaylight.yangtools.yang.model.api.PathExpression;
13 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
14 import org.opendaylight.yangtools.yang.model.api.type.LeafrefTypeDefinition;
16 final class RestrictedLeafrefType extends AbstractRestrictedType<LeafrefTypeDefinition>
17 implements LeafrefTypeDefinition {
18 private final boolean requireInstance;
20 RestrictedLeafrefType(final LeafrefTypeDefinition baseType, final QName qname,
21 final Collection<? extends UnknownSchemaNode> unknownSchemaNodes, final boolean requireInstance) {
22 super(baseType, qname, unknownSchemaNodes);
23 this.requireInstance = requireInstance;
27 public PathExpression getPathStatement() {
28 return getBaseType().getPathStatement();
32 public boolean requireInstance() {
33 return requireInstance;
37 public int hashCode() {
38 return LeafrefTypeDefinition.hashCode(this);
42 public boolean equals(final Object obj) {
43 return LeafrefTypeDefinition.equals(this, obj);
47 public String toString() {
48 return LeafrefTypeDefinition.toString(this);