Cleanup effectiveStatements() access
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / effective / CaseShorthandImpl.java
index 5f4b9a463054275b8cac9ad9225871e882d6980f..24a5a2b9732f26094cc01ae6ae3b2ea23690711a 100644 (file)
@@ -15,6 +15,7 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Objects;
 import java.util.Set;
+import javax.annotation.Nonnull;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.AugmentationSchema;
 import org.opendaylight.yangtools.yang.model.api.ChoiceCaseNode;
@@ -65,16 +66,19 @@ final class CaseShorthandImpl implements ChoiceCaseNode, DerivableSchemaNode {
         return caseShorthandNode.getConstraints();
     }
 
+    @Nonnull
     @Override
     public QName getQName() {
         return caseShorthandNode.getQName();
     }
 
+    @Nonnull
     @Override
     public SchemaPath getPath() {
         return path;
     }
 
+    @Nonnull
     @Override
     public List<UnknownSchemaNode> getUnknownSchemaNodes() {
         return ImmutableList.of();
@@ -90,6 +94,7 @@ final class CaseShorthandImpl implements ChoiceCaseNode, DerivableSchemaNode {
         return caseShorthandNode.getReference();
     }
 
+    @Nonnull
     @Override
     public Status getStatus() {
         return caseShorthandNode.getStatus();
@@ -112,11 +117,7 @@ final class CaseShorthandImpl implements ChoiceCaseNode, DerivableSchemaNode {
 
     @Override
     public DataSchemaNode getDataChildByName(final QName name) {
-        if (getQName().equals(name)) {
-            return caseShorthandNode;
-        } else {
-            return null;
-        }
+        return getQName().equals(name) ? caseShorthandNode : null;
     }
 
     @Override
@@ -160,10 +161,7 @@ final class CaseShorthandImpl implements ChoiceCaseNode, DerivableSchemaNode {
 
     @Override
     public String toString() {
-        return CaseShorthandImpl.class.getSimpleName() + "[" +
-                "qname=" +
-                getQName() +
-                "]";
+        return CaseShorthandImpl.class.getSimpleName() + "[" + "qname=" + getQName() + "]";
     }
 
     private static ChoiceCaseNode getOriginalIfPresent(final SchemaNode caseShorthandNode) {