import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
-import org.opendaylight.yangtools.concepts.Builder;
+import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.yangtools.concepts.Mutable;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.QNameModule;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-final class LeafRefContextBuilder implements Builder<LeafRefContext> {
-
+final class LeafRefContextBuilder implements Mutable {
private final Map<QName, LeafRefContext> referencingChildren = new HashMap<>();
private final Map<QName, LeafRefContext> referencedByChildren = new HashMap<>();
private final Map<QName, LeafRefContext> referencedByLeafRefCtx = new HashMap<>();
this.schemaContext = requireNonNull(schemaContext);
}
- @Override
- public LeafRefContext build() {
+ @NonNull LeafRefContext build() {
final LeafRefContext leafRefContext = new LeafRefContext(this);
// LeafRefContext has made a copy of these
}
void setReferencedBy(final boolean referencedBy) {
- this.isReferencedBy = referencedBy;
+ isReferencedBy = referencedBy;
}
boolean isReferencing() {
}
void setReferencing(final boolean referencing) {
- this.isReferencing = referencing;
+ isReferencing = referencing;
}
void addReferencingChild(final LeafRefContext child, final QName childQName) {
}
void setLeafRefTargetPath(final LeafRefPath leafRefPath) {
- this.leafRefTargetPath = requireNonNull(leafRefPath);
+ leafRefTargetPath = requireNonNull(leafRefPath);
}
String getLeafRefTargetPathString() {
}
void setLeafRefTargetPathString(final String leafRefPathString) {
- this.leafRefTargetPathString = requireNonNull(leafRefPathString);
+ leafRefTargetPathString = requireNonNull(leafRefPathString);
}
QName getCurrentNodeQName() {
package org.opendaylight.yangtools.yang.data.tree.leafref;
import java.util.List;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.QNameModule;
public interface QNameWithPredicate {
- QNameWithPredicate UP_PARENT = new QNameWithPredicateBuilder(null, "..").build();
+ @NonNull QNameWithPredicate UP_PARENT = new QNameWithPredicateBuilder(null, "..").build();
- QNameWithPredicate ROOT = new QNameWithPredicateBuilder(null, "").build();
+ @NonNull QNameWithPredicate ROOT = new QNameWithPredicateBuilder(null, "").build();
List<QNamePredicate> getQNamePredicates();
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
-import org.opendaylight.yangtools.concepts.Builder;
+import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.yangtools.concepts.Mutable;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.QNameModule;
-class QNameWithPredicateBuilder implements Builder<QNameWithPredicate> {
-
+class QNameWithPredicateBuilder implements Mutable {
private final List<QNamePredicate> qnamePredicates = new ArrayList<>();
private QNameModule moduleQname;
private String localName;
this.localName = localName;
}
- @Override
- public QNameWithPredicate build() {
+ public @NonNull QNameWithPredicate build() {
if (qnamePredicates.isEmpty() && moduleQname != null && localName != null) {
return new SimpleQNameWithPredicate(QName.create(moduleQname, localName));
}