/**\r
* Returns <code>true</code> if the data node was added by augmentation,\r
* otherwise returns <code>false</code>\r
- * \r
+ *\r
* @return <code>true</code> if the data node was added by augmentation,\r
* otherwise returns <code>false</code>\r
*/\r
boolean isAugmenting();\r
\r
+ /**\r
+ * Returns <code>true</code> if the data node was added by uses statement,\r
+ * otherwise returns <code>false</code>\r
+ *\r
+ * @return <code>true</code> if the data node was added by uses statement,\r
+ * otherwise returns <code>false</code>\r
+ */\r
+ boolean isAddedByUses();\r
+\r
/**\r
* Returns <code>true</code> if the data represents configuration data,\r
* otherwise returns <code>false</code>\r
- * \r
+ *\r
* @return <code>true</code> if the data represents configuration data,\r
* otherwise returns <code>false</code>\r
*/\r
\r
/**\r
* Returns the constraints associated with Data Schema Node\r
- * \r
+ *\r
* @return the constraints associated with Data Schema Node\r
*/\r
ConstraintDefinition getConstraints();\r
private Status status;
private String units;
private Object defaultValue;
+ private boolean addedByUses;
public static class Builder {
private final QName typeName;
private Status status = Status.CURRENT;
private String units = "";
private Object defaultValue = null;
+ private boolean addedByUses;
private List<RangeConstraint> ranges = Collections.emptyList();
private List<LengthConstraint> lengths = Collections.emptyList();
return this;
}
+ public Builder addedByUses(final boolean addedByUses) {
+ this.addedByUses = addedByUses;
+ return this;
+ }
+
public Builder unknownSchemaNodes(
final List<UnknownSchemaNode> unknownSchemaNodes) {
this.unknownSchemaNodes = unknownSchemaNodes;
this.status = builder.status;
this.units = builder.units;
this.defaultValue = builder.defaultValue;
+ this.addedByUses = builder.addedByUses;
this.ranges = builder.ranges;
this.lengths = builder.lengths;
return defaultValue;
}
+ public boolean isAddedByUses() {
+ return addedByUses;
+ }
+
@Override
public QName getQName() {
return typeName;
/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
package org.opendaylight.controller.yang.model.util;
import java.util.Collections;
import org.opendaylight.controller.yang.model.api.type.InstanceIdentifierTypeDefinition;
/**
- * The <code>default</code> implementation of Instance Identifier Type Definition interface.
+ * The <code>default</code> implementation of Instance Identifier Type
+ * Definition interface.
*
* @see InstanceIdentifierTypeDefinition
*/
public final class InstanceIdentifier implements InstanceIdentifierTypeDefinition {
- private static final QName name = BaseTypes
- .constructQName("instance-identifier");
- private static final String description = "The instance-identifier built-in type is used to " +
- "uniquely identify a particular instance node in the data tree.";
+ private static final QName name = BaseTypes.constructQName("instance-identifier");
+ private static final String description = "The instance-identifier built-in type is used to "
+ + "uniquely identify a particular instance node in the data tree.";
private static final String reference = "https://tools.ietf.org/html/rfc6020#section-9.13";
private final transient SchemaPath path;
private final RevisionAwareXPath xpath;
private final String units = "";
private final InstanceIdentifierTypeDefinition baseType;
- private final boolean requireInstance;
+ private boolean requireInstance = true;
+
+ public InstanceIdentifier(final SchemaPath path, final RevisionAwareXPath xpath) {
+ super();
+ this.path = path;
+ this.xpath = xpath;
+ this.baseType = this;
+ }
- public InstanceIdentifier(final SchemaPath path, RevisionAwareXPath xpath, boolean requireInstance) {
+ public InstanceIdentifier(final SchemaPath path, final RevisionAwareXPath xpath, final boolean requireInstance) {
super();
this.path = path;
this.xpath = xpath;
/*
* (non-Javadoc)
*
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
+ * @see
+ * org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
*/
@Override
public InstanceIdentifierTypeDefinition getBaseType() {
/*
* (non-Javadoc)
*
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()
+ * @see
+ * org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue
+ * ()
*/
@Override
public Object getDefaultValue() {
/*
* (non-Javadoc)
*
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()
+ * @see
+ * org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()
*/
@Override
public String getDescription() {
/*
* (non-Javadoc)
*
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getExtensionSchemaNodes()
+ * @see
+ * org.opendaylight.controller.yang.model.api.SchemaNode#getExtensionSchemaNodes
+ * ()
*/
@Override
public List<UnknownSchemaNode> getUnknownSchemaNodes() {
/*
* (non-Javadoc)
*
- * @see org.opendaylight.controller.yang.model.api.type.InstanceIdentifierTypeDefinition#
- * getPathStatement()
+ * @see org.opendaylight.controller.yang.model.api.type.
+ * InstanceIdentifierTypeDefinition# getPathStatement()
*/
@Override
public RevisionAwareXPath getPathStatement() {
/*
* (non-Javadoc)
*
- * @see org.opendaylight.controller.yang.model.api.type.InstanceIdentifierTypeDefinition#
- * requireInstance()
+ * @see org.opendaylight.controller.yang.model.api.type.
+ * InstanceIdentifierTypeDefinition# requireInstance()
*/
@Override
public boolean requireInstance() {