import com.google.common.collect.ImmutableList;
import java.util.List;
+import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/**
* @return string with textual description the node which represents the
* argument of the YANG <code>description</code> substatement
*/
- String getDescription();
+ @Nullable String getDescription();
/**
* Returns reference of the instance of the type <code>SchemaNode</code>
* represents the argument of the YANG <code>reference</code>
* substatement
*/
- String getReference();
+ @Nullable String getReference();
/**
* Returns status of the instance of the type <code>SchemaNode</code>
* @return status of this node which represents the argument of the YANG
* <code>status</code> substatement
*/
- @Nullable Status getStatus();
+ @Nonnull Status getStatus();
/**
* Returns unknown schema nodes which belongs to this instance.
*
* @return list of unknown schema nodes defined under this node.
*/
- default List<UnknownSchemaNode> getUnknownSchemaNodes() {
+ default @Nonnull List<UnknownSchemaNode> getUnknownSchemaNodes() {
return ImmutableList.of();
}
}
*/
package org.opendaylight.yangtools.yang.model.api;
+import javax.annotation.Nonnull;
import org.opendaylight.yangtools.yang.common.QName;
/**
* SchemaNode represents a node in schema tree.
*/
public interface SchemaNode extends DocumentedNode {
-
/**
* Returns QName of the instance of the type <code>SchemaNode</code>.
*
* @return QName with the name of the schema node
*/
- QName getQName();
+ @Nonnull QName getQName();
/**
* Returns the schema path of the instance of the type
*
* @return schema path of the schema node
*/
- SchemaPath getPath();
+ @Nonnull SchemaPath getPath();
}
import com.google.common.base.Optional;
import java.util.Map;
import java.util.Set;
+import javax.annotation.Nonnull;
/**
* Contains the methods for getting data and checking properties of the YANG
*
* @return schema path to 'grouping' on which this 'uses' statement points
*/
- SchemaPath getGroupingPath();
+ @Nonnull SchemaPath getGroupingPath();
/**
*
*
* @return Set of augment statements defined under this uses node
*/
- Set<AugmentationSchema> getAugmentations();
+ @Nonnull Set<AugmentationSchema> getAugmentations();
/**
* Returns <code>true</code> if the data node was added by augmentation,
* @return Map, where key is schema path of refined node and value is
* refined node
*/
- Map<SchemaPath, SchemaNode> getRefines();
+ @Nonnull Map<SchemaPath, SchemaNode> getRefines();
/**
* Returns when statement
*
* @return Optional of XPath condition
*/
- default Optional<RevisionAwareXPath> getWhenCondition() {
+ default @Nonnull Optional<RevisionAwareXPath> getWhenCondition() {
return Optional.absent();
}
}
package org.opendaylight.yangtools.yang.model.api.type;
import java.util.List;
-
+import javax.annotation.Nonnull;
import org.opendaylight.yangtools.yang.model.api.SchemaNode;
import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
*
*/
public interface BitsTypeDefinition extends TypeDefinition<BitsTypeDefinition> {
-
/**
* Returns all bit values.
*
* @return list of <code>Bit</code> type instastances with data about all
* individual bits of <code>bits</code> YANG built-in type
*/
- List<Bit> getBits();
+ @Nonnull List<Bit> getBits();
/**
*
*
* @return string with the name of the concrete bit
*/
- String getName();
+ @Nonnull String getName();
}
}
package org.opendaylight.yangtools.yang.model.api.type;
import java.util.List;
+import javax.annotation.Nonnull;
import org.opendaylight.yangtools.yang.model.api.DocumentedNode;
import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
*
*/
public interface EnumTypeDefinition extends TypeDefinition<EnumTypeDefinition> {
-
/**
* Returns all enumeration values.
*
* data about all individual enumeration pairs of
* <code>enumeration</code> YANG built-in type
*/
- List<EnumPair> getValues();
+ @Nonnull List<EnumPair> getValues();
/**
*
private Long position;
private String description;
private String reference;
- private Status status;
+ private Status status = Status.CURRENT;
private final List<UnknownSchemaNode> unknownSchemaNodes;
public BitEffectiveStatementImpl(final StmtContext<QName, BitStatement, ?> ctx) {
"Bit %s must have a position statement", b);
}
- final BitBuilder bitBuilder = BitBuilder.create(b.getPath(), newPos)
- .setDescription(b.getDescription()).setReference(b.getReference())
- .setUnknownSchemaNodes(b.getUnknownSchemaNodes());
- if (b.getStatus() != null) {
- bitBuilder.setStatus(b.getStatus());
- }
-
- b = bitBuilder.build();
+ b = BitBuilder.create(b.getPath(), newPos).setDescription(b.getDescription())
+ .setReference(b.getReference()).setStatus(b.getStatus())
+ .setUnknownSchemaNodes(b.getUnknownSchemaNodes()).build();
}
SourceException.throwIf(b.getPosition() < 0L && b.getPosition() > 4294967295L,