2 * Copyright (c) 2016 Cisco Systems, Inc. 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
9 package org.opendaylight.mdsal.binding.yang.types;
11 import java.util.List;
12 import java.util.Optional;
13 import org.opendaylight.yangtools.yang.common.QName;
14 import org.opendaylight.yangtools.yang.model.api.RevisionAwareXPath;
15 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
16 import org.opendaylight.yangtools.yang.model.api.Status;
17 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
18 import org.opendaylight.yangtools.yang.model.api.type.LeafrefTypeDefinition;
21 * Mock LeafrefDypeDefinition implementation with non-null referenced RevisionAwareXPath.
23 * Although RevisionAwareXPath has implemented Override for toString to return null value to reach specific branch
24 * in TypeProviderImpl#provideTypeForLeafref method.
26 * Created by lukas on 9/17/14.
28 public class LeafrefTypeWithNullToStringInXpath implements LeafrefTypeDefinition {
30 public RevisionAwareXPath getPathStatement() {
31 return new RevisionAwareXPath() {
33 public boolean isAbsolute() {
38 public String toString() {
45 public LeafrefTypeDefinition getBaseType() {
50 public Optional<String> getUnits() {
51 return Optional.empty();
55 public Optional<? extends Object> getDefaultValue() {
56 return Optional.empty();
60 public QName getQName() {
65 public SchemaPath getPath() {
70 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
75 public Optional<String> getDescription() {
76 return Optional.empty();
80 public Optional<String> getReference() {
81 return Optional.empty();
85 public Status getStatus() {
90 public boolean requireInstance() {