package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
private final DataSchemaNode caseShorthandNode;
private final QName qName;
private final SchemaPath path;
-
private final String description;
private final String reference;
private final Status status;
-
private final boolean augmenting;
private final boolean addedByUses;
private final ConstraintDefinition constraints;
- private ChoiceCaseNode original;
-
- ImmutableList<UnknownSchemaNode> unknownNodes;
+ private final List<UnknownSchemaNode> unknownNodes;
public CaseShorthandImpl(final DataSchemaNode caseShorthandNode) {
this.caseShorthandNode = caseShorthandNode;
this.qName = caseShorthandNode.getQName();
-
- SchemaPath caseShorthandNodePath = caseShorthandNode.getPath();
- Iterable<QName> pathFromRoot = caseShorthandNodePath.getPathFromRoot();
- // FIXME: cacheShorthandNodePath.getParent() should be enough
- this.path = SchemaPath
- .create(Iterables.limit(pathFromRoot,
- Iterables.size(pathFromRoot) - 1),
- caseShorthandNodePath.isAbsolute());
-
+ this.path = Preconditions.checkNotNull(caseShorthandNode.getPath().getParent());
this.description = caseShorthandNode.getDescription();
this.reference = caseShorthandNode.getReference();
this.status = caseShorthandNode.getStatus();
@Override
public Optional<? extends SchemaNode> getOriginal() {
- return Optional.fromNullable(original);
+ return Optional.absent();
}
@Override