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 static java.util.Objects.requireNonNull;
12 import java.util.Collection;
13 import org.opendaylight.yangtools.yang.common.QName;
14 import org.opendaylight.yangtools.yang.model.api.PathExpression;
15 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
16 import org.opendaylight.yangtools.yang.model.api.type.LeafrefTypeDefinition;
18 final class BaseLeafrefType extends AbstractBaseType<LeafrefTypeDefinition> implements LeafrefTypeDefinition {
19 private final PathExpression pathStatement;
20 private final boolean requireInstance;
22 BaseLeafrefType(final QName qname, final PathExpression pathStatement, final boolean requireInstance,
23 final Collection<? extends UnknownSchemaNode> unknownSchemaNodes) {
24 super(qname, unknownSchemaNodes);
25 this.pathStatement = requireNonNull(pathStatement);
26 this.requireInstance = requireInstance;
30 public PathExpression getPathStatement() {
35 public boolean requireInstance() {
36 return requireInstance;
40 public int hashCode() {
41 return LeafrefTypeDefinition.hashCode(this);
45 public boolean equals(final Object obj) {
46 return LeafrefTypeDefinition.equals(this, obj);
50 public String toString() {
51 return LeafrefTypeDefinition.toString(this);