import org.opendaylight.yangtools.yang.model.api.AnyXmlSchemaNode;
import org.opendaylight.yangtools.yang.model.api.ConstraintDefinition;
import org.opendaylight.yangtools.yang.model.api.DerivableSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.opendaylight.yangtools.yang.model.api.stmt.AnyxmlStatement;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.AnyxmlStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext.TypeOfCopy;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
ImmutableList<UnknownSchemaNode> unknownNodes;
public AnyXmlEffectiveStatementImpl(
- StmtContext<QName, AnyxmlStatement, EffectiveStatement<QName, AnyxmlStatement>> ctx) {
+ final StmtContext<QName, AnyxmlStatement, EffectiveStatement<QName, AnyxmlStatement>> ctx) {
super(ctx);
this.qname = ctx.getStatementArgument();
this.path = Utils.getSchemaPath(ctx);
}
private void initCopyType(
- StmtContext<QName, AnyxmlStatement, EffectiveStatement<QName, AnyxmlStatement>> ctx) {
+ final StmtContext<QName, AnyxmlStatement, EffectiveStatement<QName, AnyxmlStatement>> ctx) {
List<TypeOfCopy> copyTypesFromOriginal = ctx.getCopyHistory();
return result;
}
- private boolean checkQname(AnyXmlEffectiveStatementImpl other) {
- if (qname == null) {
- if (other.qname != null) {
- return false;
- }
- } else if (!qname.equals(other.qname)) {
- return false;
- }
- return true;
- }
-
- private boolean checkPath(AnyXmlEffectiveStatementImpl other) {
- if (path == null) {
- if (other.path != null) {
- return false;
- }
- } else if (!path.equals(other.path)) {
- return false;
- }
- return true;
- }
-
- private boolean checkObject(final Object obj) {
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- return true;
- }
-
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
-
- if (!checkObject(obj)) {
- return false;
- }
-
- AnyXmlEffectiveStatementImpl other = (AnyXmlEffectiveStatementImpl) obj;
-
- if (!checkQname(other)) {
+ if (obj == null) {
return false;
}
-
- if (!checkPath(other)) {
+ if (getClass() != obj.getClass()) {
return false;
}
- return true;
+ AnyXmlEffectiveStatementImpl other = (AnyXmlEffectiveStatementImpl) obj;
+ return Objects.equals(qname, other.qname) && Objects.equals(path, other.path);
}
@Override
public String toString() {
- StringBuilder sb = new StringBuilder(
- AnyXmlEffectiveStatementImpl.class.getSimpleName());
+ StringBuilder sb = new StringBuilder(AnyXmlEffectiveStatementImpl.class.getSimpleName());
sb.append("[");
sb.append("qname=").append(qname);
sb.append(", path=").append(path);
sb.append("]");
return sb.toString();
}
-
}
import org.opendaylight.yangtools.yang.model.api.stmt.ArgumentStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class ArgumentEffectiveStatementImpl extends
- EffectiveStatementBase<QName, ArgumentStatement> {
-
- public ArgumentEffectiveStatementImpl(
- StmtContext<QName, ArgumentStatement, ?> ctx) {
+public class ArgumentEffectiveStatementImpl extends EffectiveStatementBase<QName, ArgumentStatement> {
+ public ArgumentEffectiveStatementImpl(final StmtContext<QName, ArgumentStatement, ?> ctx) {
super(ctx);
}
-
}
\ No newline at end of file
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
import static com.google.common.base.Preconditions.checkNotNull;
-
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableList;
import java.net.URI;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.QNameModule;
import org.opendaylight.yangtools.yang.model.api.AugmentationSchema;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.NamespaceRevisionAware;
import org.opendaylight.yangtools.yang.model.api.RevisionAwareXPath;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
+import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.AugmentStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier;
-import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.stmt.reactor.StatementContextBase;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
public class AugmentEffectiveStatementImpl
extends
AbstractEffectiveDocumentedDataNodeContainer<SchemaNodeIdentifier, AugmentStatement>
- implements AugmentationSchema, NamespaceRevisionAware,
- Comparable<AugmentEffectiveStatementImpl> {
- private final int order;
+ implements AugmentationSchema, NamespaceRevisionAware, Comparable<AugmentEffectiveStatementImpl> {
private final SchemaPath targetPath;
- RevisionAwareXPath whenCondition;
-
- URI namespace;
- Date revision;
- ImmutableList<UnknownSchemaNode> unknownNodes;
+ private final URI namespace;
+ private final Date revision;
+ private final int order;
+ private ImmutableList<UnknownSchemaNode> unknownNodes;
+ private RevisionAwareXPath whenCondition;
private AugmentationSchema copyOf;
public AugmentEffectiveStatementImpl(
- StmtContext<SchemaNodeIdentifier, AugmentStatement, EffectiveStatement<SchemaNodeIdentifier, AugmentStatement>> ctx){
-
+ final StmtContext<SchemaNodeIdentifier, AugmentStatement, EffectiveStatement<SchemaNodeIdentifier, AugmentStatement>> ctx) {
super(ctx);
SchemaNodeIdentifier schemaNodeIdentifier = ctx.getStatementArgument();
}
private void initCopyOf(
- StmtContext<SchemaNodeIdentifier, AugmentStatement, EffectiveStatement<SchemaNodeIdentifier, AugmentStatement>> ctx) {
+ final StmtContext<SchemaNodeIdentifier, AugmentStatement, EffectiveStatement<SchemaNodeIdentifier, AugmentStatement>> ctx) {
StatementContextBase<?, ?, ?> originalCtx = ctx.getOriginalCtx();
if (originalCtx != null) {
this.copyOf = (AugmentationSchema) originalCtx.buildEffective();
return false;
}
AugmentEffectiveStatementImpl other = (AugmentEffectiveStatementImpl) obj;
- if (targetPath == null) {
- if (other.targetPath != null) {
- return false;
- }
- } else if (!targetPath.equals(other.targetPath)) {
+ if (!Objects.equals(targetPath, other.targetPath)) {
return false;
}
- if (whenCondition == null) {
- if (other.whenCondition != null) {
- return false;
- }
- } else if (!whenCondition.equals(other.whenCondition)) {
+ if (!Objects.equals(whenCondition, other.whenCondition)) {
return false;
}
if (!getChildNodes().equals(other.getChildNodes())) {
public int compareTo(final AugmentEffectiveStatementImpl o) {
checkNotNull(o);
Iterator<QName> thisIt = this.targetPath.getPathFromRoot().iterator();
- Iterator<QName> otherIt = o.getTargetPath().getPathFromRoot()
- .iterator();
+ Iterator<QName> otherIt = o.getTargetPath().getPathFromRoot().iterator();
while (thisIt.hasNext()) {
if (otherIt.hasNext()) {
int comp = thisIt.next().compareTo(otherIt.next());
import org.opendaylight.yangtools.yang.model.api.stmt.BaseStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class BaseEffectiveStatementImpl extends
- EffectiveStatementBase<QName, BaseStatement> {
+public class BaseEffectiveStatementImpl extends EffectiveStatementBase<QName, BaseStatement> {
- public BaseEffectiveStatementImpl(StmtContext<QName, BaseStatement, ?> ctx) {
+ public BaseEffectiveStatementImpl(final StmtContext<QName, BaseStatement, ?> ctx) {
super(ctx);
}
import org.opendaylight.yangtools.yang.model.api.stmt.BelongsToStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class BelongsEffectiveToStatementImpl extends
- EffectiveStatementBase<String, BelongsToStatement> {
-
- public BelongsEffectiveToStatementImpl(
- StmtContext<String, BelongsToStatement, ?> ctx) {
+public class BelongsEffectiveToStatementImpl extends EffectiveStatementBase<String, BelongsToStatement> {
+ public BelongsEffectiveToStatementImpl(final StmtContext<String, BelongsToStatement, ?> ctx) {
super(ctx);
}
-
}
import org.opendaylight.yangtools.yang.model.api.ChoiceCaseNode;
import org.opendaylight.yangtools.yang.model.api.ConstraintDefinition;
import org.opendaylight.yangtools.yang.model.api.DerivableSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.opendaylight.yangtools.yang.model.api.stmt.CaseStatement;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.CaseStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext.TypeOfCopy;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
-public class CaseEffectiveStatementImpl extends
- AbstractEffectiveDocumentedDataNodeContainer<QName, CaseStatement>
+public class CaseEffectiveStatementImpl extends AbstractEffectiveDocumentedDataNodeContainer<QName, CaseStatement>
implements ChoiceCaseNode, DerivableSchemaNode {
private final QName qname;
private final SchemaPath path;
+ private final ConstraintDefinition constraints;
- boolean augmenting;
- boolean addedByUses;
- ChoiceCaseNode original;
- ConstraintDefinition constraints;
-
- ImmutableSet<AugmentationSchema> augmentations;
- ImmutableList<UnknownSchemaNode> unknownNodes;
+ private boolean augmenting;
+ private boolean addedByUses;
+ private ChoiceCaseNode original;
+ private ImmutableSet<AugmentationSchema> augmentations;
+ private ImmutableList<UnknownSchemaNode> unknownNodes;
public CaseEffectiveStatementImpl(
- StmtContext<QName, CaseStatement, EffectiveStatement<QName, CaseStatement>> ctx) {
+ final StmtContext<QName, CaseStatement, EffectiveStatement<QName, CaseStatement>> ctx) {
super(ctx);
this.qname = ctx.getStatementArgument();
this.path = Utils.getSchemaPath(ctx);
}
private void initCopyType(
- StmtContext<QName, CaseStatement, EffectiveStatement<QName, CaseStatement>> ctx) {
+ final StmtContext<QName, CaseStatement, EffectiveStatement<QName, CaseStatement>> ctx) {
List<TypeOfCopy> copyTypesFromOriginal = ctx.getCopyHistory();
return false;
}
CaseEffectiveStatementImpl other = (CaseEffectiveStatementImpl) obj;
- if (qname == null) {
- if (other.qname != null) {
- return false;
- }
- } else if (!qname.equals(other.qname)) {
- return false;
- }
- if (path == null) {
- if (other.path != null) {
- return false;
- }
- } else if (!path.equals(other.path)) {
- return false;
- }
- return true;
+ return Objects.equals(qname, other.qname) && Objects.equals(path, other.path);
}
@Override
public String toString() {
- StringBuilder sb = new StringBuilder(
- CaseEffectiveStatementImpl.class.getSimpleName());
+ StringBuilder sb = new StringBuilder(CaseEffectiveStatementImpl.class.getSimpleName());
sb.append("[");
sb.append("qname=");
sb.append(qname);
sb.append("]");
return sb.toString();
}
-
}
private final boolean augmenting;
private final boolean addedByUses;
- ConstraintDefinition constraints;
+ private final ConstraintDefinition constraints;
private ChoiceCaseNode original;
ImmutableList<UnknownSchemaNode> unknownNodes;
- public CaseShorthandImpl(DataSchemaNode caseShorthandNode) {
+ 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),
}
@Override
- public DataSchemaNode getDataChildByName(QName name) {
+ public DataSchemaNode getDataChildByName(final QName name) {
if (qName.equals(name)) {
return caseShorthandNode;
} else {
}
@Override
- public DataSchemaNode getDataChildByName(String name) {
+ public DataSchemaNode getDataChildByName(final String name) {
if (qName.getLocalName().equals(name)) {
return caseShorthandNode;
} else {
return false;
}
CaseShorthandImpl other = (CaseShorthandImpl) obj;
- if (qName == null) {
- if (other.qName != null) {
- return false;
- }
- } else if (!qName.equals(other.qName)) {
- return false;
- }
- if (path == null) {
- if (other.path != null) {
- return false;
- }
- } else if (!path.equals(other.path)) {
- return false;
- }
- return true;
+ return Objects.equals(qName, other.qName) && Objects.equals(path, other.path);
}
@Override
public String toString() {
- StringBuilder sb = new StringBuilder(
- CaseShorthandImpl.class.getSimpleName());
+ StringBuilder sb = new StringBuilder(CaseShorthandImpl.class.getSimpleName());
sb.append("[");
sb.append("qname=");
sb.append(qName);
sb.append("]");
return sb.toString();
}
-
}
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.ImmutableSet;
import java.util.Collection;
private final QName qname;
private final SchemaPath path;
- boolean augmenting;
- boolean addedByUses;
- ChoiceSchemaNode original;
- boolean configuration = true;
- ConstraintDefinition constraints;
- String defaultCase;
+ private boolean augmenting;
+ private boolean addedByUses;
+ private ChoiceSchemaNode original;
+ private boolean configuration = true;
+ private final ConstraintDefinition constraints;
+ private String defaultCase;
- ImmutableSet<ChoiceCaseNode> cases;
- ImmutableSet<AugmentationSchema> augmentations;
- ImmutableList<UnknownSchemaNode> unknownNodes;
+ private ImmutableSet<ChoiceCaseNode> cases;
+ private ImmutableSet<AugmentationSchema> augmentations;
+ private ImmutableList<UnknownSchemaNode> unknownNodes;
public ChoiceEffectiveStatementImpl(
final StmtContext<QName, ChoiceStatement, EffectiveStatement<QName, ChoiceStatement>> ctx) {
if (copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES)) {
addedByUses = true;
}
- if (copyTypesFromOriginal
- .contains(TypeOfCopy.ADDED_BY_USES_AUGMENTATION)) {
+ if (copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES_AUGMENTATION)) {
addedByUses = augmenting = true;
}
|| effectiveStatement instanceof LeafSchemaNode) {
DataSchemaNode dataSchemaNode = (DataSchemaNode) effectiveStatement;
- ChoiceCaseNode shorthandCase = new CaseShorthandImpl(
- dataSchemaNode);
+ ChoiceCaseNode shorthandCase = new CaseShorthandImpl(dataSchemaNode);
casesInit.add(shorthandCase);
if (dataSchemaNode.isAugmenting() && !this.augmenting) {
resetAugmenting(dataSchemaNode);
}
}
- if (!configurationInit
- && effectiveStatement instanceof ConfigEffectiveStatementImpl) {
+ if (!configurationInit && effectiveStatement instanceof ConfigEffectiveStatementImpl) {
ConfigEffectiveStatementImpl configStmt = (ConfigEffectiveStatementImpl) effectiveStatement;
this.configuration = configStmt.argument();
configurationInit = true;
}
- if (!defaultInit
- && effectiveStatement instanceof DefaultEffectiveStatementImpl) {
+ if (!defaultInit && effectiveStatement instanceof DefaultEffectiveStatementImpl) {
DefaultEffectiveStatementImpl defaultCaseStmt = (DefaultEffectiveStatementImpl) effectiveStatement;
this.defaultCase = defaultCaseStmt.argument();
defaultInit = true;
@Override
public ChoiceCaseNode getCaseNodeByName(final QName name) {
- if (name == null) {
- throw new IllegalArgumentException(
- "Choice Case QName cannot be NULL!");
- }
+ Preconditions.checkArgument(name != null, "Choice Case QName cannot be NULL!");
+
for (final ChoiceCaseNode caseNode : cases) {
if (caseNode != null && name.equals(caseNode.getQName())) {
return caseNode;
@Override
public ChoiceCaseNode getCaseNodeByName(final String name) {
- if (name == null) {
- throw new IllegalArgumentException(
- "Choice Case string Name cannot be NULL!");
- }
+ Preconditions.checkArgument(name != null, "Choice Case string Name cannot be NULL!");
+
for (final ChoiceCaseNode caseNode : cases) {
if (caseNode != null && (caseNode.getQName() != null)
&& name.equals(caseNode.getQName().getLocalName())) {
return false;
}
ChoiceEffectiveStatementImpl other = (ChoiceEffectiveStatementImpl) obj;
- if (qname == null) {
- if (other.qname != null) {
- return false;
- }
- } else if (!qname.equals(other.qname)) {
- return false;
- }
- if (path == null) {
- if (other.path != null) {
- return false;
- }
- } else if (!path.equals(other.path)) {
- return false;
- }
- return true;
+ return Objects.equals(qname, other.qname) && Objects.equals(path, other.path);
}
@Override
public String toString() {
- StringBuilder sb = new StringBuilder(
- ChoiceEffectiveStatementImpl.class.getSimpleName());
+ StringBuilder sb = new StringBuilder(ChoiceEffectiveStatementImpl.class.getSimpleName());
sb.append("[");
sb.append("qname=").append(qname);
sb.append("]");
return sb.toString();
}
-
}
import org.opendaylight.yangtools.yang.model.api.stmt.ConfigStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class ConfigEffectiveStatementImpl extends
- EffectiveStatementBase<Boolean, ConfigStatement> {
-
- public ConfigEffectiveStatementImpl(
- StmtContext<Boolean, ConfigStatement, ?> ctx) {
+public class ConfigEffectiveStatementImpl extends EffectiveStatementBase<Boolean, ConfigStatement> {
+ public ConfigEffectiveStatementImpl(final StmtContext<Boolean, ConfigStatement, ?> ctx) {
super(ctx);
-
}
}
import org.opendaylight.yangtools.yang.model.api.stmt.ContactStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class ContactEffectiveStatementImpl extends
- EffectiveStatementBase<String, ContactStatement> {
-
- public ContactEffectiveStatementImpl(
- StmtContext<String, ContactStatement, ?> ctx) {
+public class ContactEffectiveStatementImpl extends EffectiveStatementBase<String, ContactStatement> {
+ public ContactEffectiveStatementImpl(final StmtContext<String, ContactStatement, ?> ctx) {
super(ctx);
-
}
}
import org.opendaylight.yangtools.yang.model.api.ConstraintDefinition;
import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
import org.opendaylight.yangtools.yang.model.api.DerivableSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.opendaylight.yangtools.yang.model.api.stmt.ContainerStatement;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.ContainerStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext.TypeOfCopy;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
private final SchemaPath path;
private boolean presence;
+
+ // FIXME: should be private
boolean augmenting;
private boolean addedByUses;
private boolean configuration = true;
private ContainerSchemaNode original;
- private ConstraintDefinition constraints;
+ private final ConstraintDefinition constraints;
private ImmutableSet<AugmentationSchema> augmentations;
private ImmutableList<UnknownSchemaNode> unknownNodes;
public ContainerEffectiveStatementImpl(
- StmtContext<QName, ContainerStatement, EffectiveStatement<QName, ContainerStatement>> ctx) {
+ final StmtContext<QName, ContainerStatement, EffectiveStatement<QName, ContainerStatement>> ctx) {
super(ctx);
qname = ctx.getStatementArgument();
}
private void initCopyType(
- StmtContext<QName, ContainerStatement, EffectiveStatement<QName, ContainerStatement>> ctx) {
+ final StmtContext<QName, ContainerStatement, EffectiveStatement<QName, ContainerStatement>> ctx) {
List<TypeOfCopy> copyTypesFromOriginal = ctx.getCopyHistory();
- if(copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_AUGMENTATION)) {
+ if (copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_AUGMENTATION)) {
augmenting = true;
}
- if(copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES)) {
+ if (copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES)) {
addedByUses = true;
}
- if(copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES_AUGMENTATION)) {
+ if (copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES_AUGMENTATION)) {
addedByUses = augmenting = true;
}
if (effectiveSubstatement instanceof PresenceEffectiveStatementImpl) {
presence = true;
}
- if (!configurationInit
- && effectiveSubstatement instanceof ConfigEffectiveStatementImpl) {
+ if (!configurationInit && effectiveSubstatement instanceof ConfigEffectiveStatementImpl) {
ConfigEffectiveStatementImpl configStmt = (ConfigEffectiveStatementImpl) effectiveSubstatement;
this.configuration = configStmt.argument();
configurationInit = true;
return false;
}
ContainerEffectiveStatementImpl other = (ContainerEffectiveStatementImpl) obj;
- if (qname == null) {
- if (other.qname != null) {
- return false;
- }
- } else if (!qname.equals(other.qname)) {
- return false;
- }
- if (path == null) {
- if (other.path != null) {
- return false;
- }
- } else if (!path.equals(other.path)) {
- return false;
- }
- return true;
+ return Objects.equals(qname, other.qname) && Objects.equals(path, other.path);
}
@Override
import org.opendaylight.yangtools.yang.model.api.stmt.DefaultStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class DefaultEffectiveStatementImpl extends
- EffectiveStatementBase<String, DefaultStatement> {
-
- public DefaultEffectiveStatementImpl(
- StmtContext<String, DefaultStatement, ?> ctx) {
+public class DefaultEffectiveStatementImpl extends EffectiveStatementBase<String, DefaultStatement> {
+ public DefaultEffectiveStatementImpl(final StmtContext<String, DefaultStatement, ?> ctx) {
super(ctx);
}
-
}
\ No newline at end of file
*/
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
-import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-
import org.opendaylight.yangtools.yang.model.api.stmt.DescriptionStatement;
+import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class DescriptionEffectiveStatementImpl extends
- EffectiveStatementBase<String, DescriptionStatement> {
-
- public DescriptionEffectiveStatementImpl(
- StmtContext<String, DescriptionStatement, ?> ctx) {
+public class DescriptionEffectiveStatementImpl extends EffectiveStatementBase<String, DescriptionStatement> {
+ public DescriptionEffectiveStatementImpl(final StmtContext<String, DescriptionStatement, ?> ctx) {
super(ctx);
}
-
}
import org.opendaylight.yangtools.yang.model.api.stmt.DeviateStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class DeviateEffectiveStatementImpl extends
- EffectiveStatementBase<Deviation.Deviate, DeviateStatement> {
- public DeviateEffectiveStatementImpl(
- StmtContext<Deviation.Deviate, DeviateStatement, ?> ctx) {
+public class DeviateEffectiveStatementImpl extends EffectiveStatementBase<Deviation.Deviate, DeviateStatement> {
+ public DeviateEffectiveStatementImpl(final StmtContext<Deviation.Deviate, DeviateStatement, ?> ctx) {
super(ctx);
}
}
\ No newline at end of file
public class DeviationEffectiveStatementImpl extends EffectiveStatementBase<SchemaNodeIdentifier, DeviationStatement>
implements Deviation, Immutable {
- private SchemaPath targetPath;
+ private final SchemaPath targetPath;
private Deviate deviate;
private String reference;
- private ImmutableList<UnknownSchemaNode> unknownSchemaNodes;
+ private final ImmutableList<UnknownSchemaNode> unknownSchemaNodes;
- public DeviationEffectiveStatementImpl(StmtContext<SchemaNodeIdentifier, DeviationStatement, ?> ctx) {
+ public DeviationEffectiveStatementImpl(final StmtContext<SchemaNodeIdentifier, DeviationStatement, ?> ctx) {
super(ctx);
List<UnknownSchemaNode> unknownSchemaNodesInit = new LinkedList<>();
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
return false;
}
DeviationEffectiveStatementImpl other = (DeviationEffectiveStatementImpl) obj;
- if (targetPath == null) {
- if (other.targetPath != null) {
- return false;
- }
- } else if (!targetPath.equals(other.targetPath)) {
+ if (!Objects.equals(targetPath, other.targetPath)) {
return false;
}
- if (deviate == null) {
- if (other.deviate != null) {
- return false;
- }
- } else if (!deviate.equals(other.deviate)) {
+ if (!Objects.equals(deviate, other.deviate)) {
return false;
}
- if (reference == null) {
- if (other.reference != null) {
- return false;
- }
- } else if (!reference.equals(other.reference)) {
+ if (!Objects.equals(reference, other.reference)) {
return false;
}
return true;
private final Integer minElements;
private final Integer maxElements;
- public EffectiveConstraintDefinitionImpl(EffectiveStatementBase<?, ?> parent) {
+ public EffectiveConstraintDefinitionImpl(final EffectiveStatementBase<?, ?> parent) {
MandatoryEffectiveStatementImpl firstMandatoryStmt = parent
.firstEffective(MandatoryEffectiveStatementImpl.class);
return false;
}
EffectiveConstraintDefinitionImpl other = (EffectiveConstraintDefinitionImpl) obj;
- if (whenCondition == null) {
- if (other.whenCondition != null) {
- return false;
- }
- } else if (!whenCondition.equals(other.whenCondition)) {
+ if (!mandatory.equals(other.mandatory)) {
return false;
}
- if (mustConstraints == null) {
- if (other.mustConstraints != null) {
- return false;
- }
- } else if (!mustConstraints.equals(other.mustConstraints)) {
+ if (!Objects.equals(whenCondition, other.whenCondition)) {
return false;
}
- if (!mandatory.equals(other.mandatory)) {
+ if (!Objects.equals(mustConstraints, other.mustConstraints)) {
return false;
}
- if (minElements == null) {
- if (other.minElements != null) {
- return false;
- }
- } else if (!minElements.equals(other.minElements)) {
+ if (!Objects.equals(minElements, other.minElements)) {
return false;
}
- if (maxElements == null) {
- if (other.maxElements != null) {
- return false;
- }
- } else if (!maxElements.equals(other.maxElements)) {
+ if (!Objects.equals(maxElements, other.maxElements)) {
return false;
}
return true;
@Override
public String toString() {
- StringBuilder sb = new StringBuilder(
- EffectiveConstraintDefinitionImpl.class.getSimpleName());
+ StringBuilder sb = new StringBuilder(EffectiveConstraintDefinitionImpl.class.getSimpleName());
sb.append("[");
sb.append("whenCondition=").append(whenCondition);
sb.append(", mustConstraints=").append(mustConstraints);
*/
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
-import java.util.HashMap;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-
-import com.google.common.collect.ImmutableMap;
-import java.util.LinkedHashMap;
-import org.opendaylight.yangtools.yang.parser.util.ModuleDependencySort;
-import java.util.HashSet;
import com.google.common.collect.ImmutableList;
-import java.util.List;
-import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSetMultimap;
import com.google.common.collect.Multimaps;
import com.google.common.collect.SetMultimap;
import java.net.URI;
import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.ModuleIdentifier;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.parser.util.ModuleDependencySort;
public class EffectiveSchemaContext extends AbstractEffectiveSchemaContext {
private final ImmutableList<DeclaredStatement<?>> rootDeclaredStatements;
private final ImmutableList<EffectiveStatement<?, ?>> rootEffectiveStatements;
- public EffectiveSchemaContext(
- List<DeclaredStatement<?>> rootDeclaredStatements,
- List<EffectiveStatement<?, ?>> rootEffectiveStatements) {
- this.rootDeclaredStatements = ImmutableList
- .copyOf(rootDeclaredStatements);
- this.rootEffectiveStatements = ImmutableList
- .copyOf(rootEffectiveStatements);
+ public EffectiveSchemaContext(final List<DeclaredStatement<?>> rootDeclaredStatements,
+ final List<EffectiveStatement<?, ?>> rootEffectiveStatements) {
+ this.rootDeclaredStatements = ImmutableList.copyOf(rootDeclaredStatements);
+ this.rootEffectiveStatements = ImmutableList.copyOf(rootEffectiveStatements);
Set<Module> modulesInit = new HashSet<>();
for (EffectiveStatement<?, ?> rootEffectiveStatement : rootEffectiveStatements) {
@Override
protected Map<ModuleIdentifier, String> getIdentifiersToSources() {
-
return identifiersToSources;
}
@Override
public Set<Module> getModules() {
-
return modules;
}
@Override
protected SetMultimap<URI, Module> getNamespaceToModules() {
-
return namespaceToModules;
}
@Override
protected SetMultimap<String, Module> getNameToModules() {
-
return nameToModules;
}
@Override
public String toString() {
-
return String.format("SchemaContextImpl{modules=%s}", modules);
}
}
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContextUtils;
import org.opendaylight.yangtools.yang.parser.stmt.reactor.StatementContextBase;
-abstract public class EffectiveStatementBase<A, D extends DeclaredStatement<A>>
- implements EffectiveStatement<A, D> {
-
+abstract public class EffectiveStatementBase<A, D extends DeclaredStatement<A>> implements EffectiveStatement<A, D> {
private final StmtContext<A, D, ?> stmtCtx;
private final ImmutableList<? extends EffectiveStatement<?, ?>> substatements;
private final StatementSource statementSource;
private final StatementDefinition statementDefinition;
- private D declaredInstance;
-
private final A argument;
+ private D declaredInstance;
public EffectiveStatementBase(final StmtContext<A, D, ?> ctx) {
this.argument = ctx.getStatementArgument();
this.statementSource = ctx.getStatementSource();
- Collection<StatementContextBase<?, ?, ?>> declaredSubstatements = ctx
- .declaredSubstatements();
- Collection<StatementContextBase<?, ?, ?>> effectiveSubstatements = ctx
- .effectiveSubstatements();
+ Collection<StatementContextBase<?, ?, ?>> declaredSubstatements = ctx.declaredSubstatements();
+ Collection<StatementContextBase<?, ?, ?>> effectiveSubstatements = ctx.effectiveSubstatements();
Collection<StatementContextBase<?, ?, ?>> substatementsInit = new LinkedList<>();
}
@Override
- public <K, V, N extends IdentifierNamespace<K, V>> V get(
- final Class<N> namespace, final K identifier) {
+ public <K, V, N extends IdentifierNamespace<K, V>> V get(final Class<N> namespace, final K identifier) {
return stmtCtx.getFromNamespace(namespace, identifier);
}
@Override
- public <K, V, N extends IdentifierNamespace<K, V>> Map<K, V> getAll(
- final Class<N> namespace) {
+ public <K, V, N extends IdentifierNamespace<K, V>> Map<K, V> getAll(final Class<N> namespace) {
return stmtCtx.getAllFromNamespace(namespace);
}
return stmtCtx;
}
- protected final <S extends EffectiveStatement<?, ?>> S firstEffective(
- final Class<S> type) {
+ protected final <S extends EffectiveStatement<?, ?>> S firstEffective(final Class<S> type) {
S result = null;
try {
- result = type.cast(Iterables.find(substatements,
- Predicates.instanceOf(type)));
+ result = type.cast(Iterables.find(substatements, Predicates.instanceOf(type)));
} catch (NoSuchElementException e) {
result = null;
}
protected final <S extends SchemaNode> S firstSchemaNode(final Class<S> type) {
S result = null;
try {
- result = type.cast(Iterables.find(substatements,
- Predicates.instanceOf(type)));
+ result = type.cast(Iterables.find(substatements, Predicates.instanceOf(type)));
} catch (NoSuchElementException e) {
result = null;
}
}
@SuppressWarnings("unchecked")
- protected final <T> Collection<T> allSubstatementsOfType(
- final Class<T> type) {
+ protected final <T> Collection<T> allSubstatementsOfType(final Class<T> type) {
Collection<T> result = null;
try {
- result = Collection.class.cast(Collections2.filter(substatements,
- Predicates.instanceOf(type)));
+ result = Collection.class.cast(Collections2.filter(substatements, Predicates.instanceOf(type)));
} catch (NoSuchElementException e) {
result = Collections.emptyList();
}
protected final <T> T firstSubstatementOfType(final Class<T> type) {
T result = null;
try {
- result = type.cast(Iterables.find(substatements,
- Predicates.instanceOf(type)));
+ result = type.cast(Iterables.find(substatements, Predicates.instanceOf(type)));
} catch (NoSuchElementException e) {
result = null;
}
return result;
}
- protected final <R> R firstSubstatementOfType(final Class<?> type,
- final Class<R> returnType) {
+ protected final <R> R firstSubstatementOfType(final Class<?> type, final Class<R> returnType) {
R result = null;
try {
- result = returnType.cast(Iterables.find(
- substatements,
- Predicates.and(Predicates.instanceOf(type),
- Predicates.instanceOf(returnType))));
+ result = returnType.cast(Iterables.find(substatements,
+ Predicates.and(Predicates.instanceOf(type), Predicates.instanceOf(returnType))));
} catch (NoSuchElementException e) {
result = null;
}
return result;
}
-
}
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
-
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
public class EffectiveStmtUtils {
- private EffectiveStmtUtils(){
+ private EffectiveStmtUtils() {
throw new UnsupportedOperationException("Utility class");
}
- public static final SourceException createNameCollisionSourceException(
- final StmtContext<?, ?, ?> ctx,
- EffectiveStatement<?, ?> effectiveStatement) {
+ public static final SourceException createNameCollisionSourceException(final StmtContext<?, ?, ?> ctx,
+ final EffectiveStatement<?, ?> effectiveStatement) {
return new SourceException("Error in module '"
+ ctx.getRoot().getStatementArgument()
+ "': can not add '"
import org.opendaylight.yangtools.yang.model.api.stmt.ErrorAppTagStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class ErrorAppTagEffectiveStatementImpl extends
- EffectiveStatementBase<String, ErrorAppTagStatement> {
-
- public ErrorAppTagEffectiveStatementImpl(
- StmtContext<String, ErrorAppTagStatement, ?> ctx) {
+public class ErrorAppTagEffectiveStatementImpl extends EffectiveStatementBase<String, ErrorAppTagStatement> {
+ public ErrorAppTagEffectiveStatementImpl(final StmtContext<String, ErrorAppTagStatement, ?> ctx) {
super(ctx);
-
}
-
}
\ No newline at end of file
import org.opendaylight.yangtools.yang.model.api.stmt.ErrorMessageStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class ErrorMessageEffectiveStatementImpl extends
- EffectiveStatementBase<String, ErrorMessageStatement> {
-
- public ErrorMessageEffectiveStatementImpl(
- StmtContext<String, ErrorMessageStatement, ?> ctx) {
+public class ErrorMessageEffectiveStatementImpl extends EffectiveStatementBase<String, ErrorMessageStatement> {
+ public ErrorMessageEffectiveStatementImpl(final StmtContext<String, ErrorMessageStatement, ?> ctx) {
super(ctx);
-
}
-
}
\ No newline at end of file
this.isExtended = isExtended;
qName = initQName(ctx, isExtended);
- final StmtContext<?, TypedefStatement, EffectiveStatement<QName, TypedefStatement>> typeStmt = ctx
- .getFromNamespace(TypeNamespace.class, qName);
+ final StmtContext<?, TypedefStatement, EffectiveStatement<QName, TypedefStatement>> typeStmt =
+ ctx.getFromNamespace(TypeNamespace.class, qName);
if (typeStmt == null) {
path = Utils.getSchemaPath(ctx);
} else {
import java.util.Objects;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.api.ExtensionDefinition;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.opendaylight.yangtools.yang.model.api.stmt.ExtensionStatement;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.ExtensionStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
-public class ExtensionEffectiveStatementImpl extends
- AbstractEffectiveDocumentedNode<QName, ExtensionStatement> implements
- ExtensionDefinition {
+public class ExtensionEffectiveStatementImpl extends AbstractEffectiveDocumentedNode<QName, ExtensionStatement>
+ implements ExtensionDefinition {
private final QName qname;
- String argument;
+ private String argument;
private final SchemaPath schemaPath;
- ImmutableList<UnknownSchemaNode> unknownNodes;
- boolean yin;
+ private ImmutableList<UnknownSchemaNode> unknownNodes;
+ private boolean yin;
public ExtensionEffectiveStatementImpl(
- StmtContext<QName, ExtensionStatement, EffectiveStatement<QName, ExtensionStatement>> ctx) {
+ final StmtContext<QName, ExtensionStatement, EffectiveStatement<QName, ExtensionStatement>> ctx) {
super(ctx);
this.qname = ctx.getStatementArgument();
initSubstatementCollections();
initFields();
-
}
private void initFields() {
return false;
}
ExtensionEffectiveStatementImpl other = (ExtensionEffectiveStatementImpl) obj;
- if (qname == null) {
- if (other.qname != null) {
- return false;
- }
- } else if (!qname.equals(other.qname)) {
- return false;
- }
- if (schemaPath == null) {
- if (other.schemaPath != null) {
- return false;
- }
- } else if (!schemaPath.equals(other.schemaPath)) {
- return false;
- }
- return true;
+ return Objects.equals(qname, other.qname) && Objects.equals(schemaPath, other.schemaPath);
}
@Override
public String toString() {
- StringBuilder sb = new StringBuilder(
- ExtensionEffectiveStatementImpl.class.getSimpleName());
+ StringBuilder sb = new StringBuilder(ExtensionEffectiveStatementImpl.class.getSimpleName());
sb.append("[");
sb.append("argument=").append(argument);
sb.append(", qname=").append(qname);
import java.util.Objects;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.api.FeatureDefinition;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
import org.opendaylight.yangtools.yang.model.api.Status;
-import org.opendaylight.yangtools.yang.model.api.stmt.FeatureStatement;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.FeatureStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
public class FeatureEffectiveStatementImpl extends EffectiveStatementBase<QName, FeatureStatement> implements
FeatureDefinition {
- private QName qName;
- private SchemaPath path;
+ private final QName qName;
+ private final SchemaPath path;
private List<UnknownSchemaNode> unknownSchemaNodes;
private String description;
private String reference;
private Status status;
- public FeatureEffectiveStatementImpl(StmtContext<QName, FeatureStatement, ?> ctx) {
+ public FeatureEffectiveStatementImpl(final StmtContext<QName, FeatureStatement, ?> ctx) {
super(ctx);
this.qName = ctx.getStatementArgument();
return false;
}
FeatureEffectiveStatementImpl other = (FeatureEffectiveStatementImpl) obj;
- if (qName == null) {
- if (other.qName != null) {
- return false;
- }
- } else if (!qName.equals(other.qName)) {
- return false;
- }
- if (path == null) {
- if (other.path != null) {
- return false;
- }
- } else if (!path.equals(other.path)) {
- return false;
- }
- return true;
+ return Objects.equals(qName, other.qName) && Objects.equals(path, other.path);
}
@Override
import org.opendaylight.yangtools.yang.model.api.stmt.FractionDigitsStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class FractionDigitsEffectiveStatementImpl extends
- EffectiveStatementBase<Integer, FractionDigitsStatement> {
-
- public FractionDigitsEffectiveStatementImpl(
- StmtContext<Integer, FractionDigitsStatement, ?> ctx) {
+public class FractionDigitsEffectiveStatementImpl extends EffectiveStatementBase<Integer, FractionDigitsStatement> {
+ public FractionDigitsEffectiveStatementImpl(final StmtContext<Integer, FractionDigitsStatement, ?> ctx) {
super(ctx);
-
}
-
}
\ No newline at end of file
private List<UnknownSchemaNode> unknownNodes;
public GroupingEffectiveStatementImpl(
- StmtContext<QName, GroupingStatement, EffectiveStatement<QName, GroupingStatement>> ctx) {
+ final StmtContext<QName, GroupingStatement, EffectiveStatement<QName, GroupingStatement>> ctx) {
super(ctx);
qname = ctx.getStatementArgument();
}
private void initCopyType(
- StmtContext<QName, GroupingStatement, EffectiveStatement<QName, GroupingStatement>> ctx) {
+ final StmtContext<QName, GroupingStatement, EffectiveStatement<QName, GroupingStatement>> ctx) {
List<TypeOfCopy> copyTypesFromOriginal = ctx.getCopyHistory();
- if(copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES)) {
+ if (copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES)) {
addedByUses = true;
}
}
unknownNodes.add(unknownNode);
}
}
-
}
@Override
return false;
}
final GroupingEffectiveStatementImpl other = (GroupingEffectiveStatementImpl) obj;
- if (qname == null) {
- if (other.qname != null) {
- return false;
- }
- } else if (!qname.equals(other.qname)) {
- return false;
- }
- if (path == null) {
- if (other.path != null) {
- return false;
- }
- } else if (!path.equals(other.path)) {
- return false;
- }
- return true;
+ return Objects.equals(qname, other.qname) && Objects.equals(path, other.path);
}
@Override
import java.util.Set;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.api.IdentitySchemaNode;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.opendaylight.yangtools.yang.model.api.stmt.IdentityStatement;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.IdentityStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.DerivedIdentitiesNamespace;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
-public class IdentityEffectiveStatementImpl extends
- AbstractEffectiveDocumentedNode<QName, IdentityStatement> implements
- IdentitySchemaNode {
+public class IdentityEffectiveStatementImpl extends AbstractEffectiveDocumentedNode<QName, IdentityStatement>
+ implements IdentitySchemaNode {
private final QName qname;
private final SchemaPath path;
- IdentitySchemaNode baseIdentity;
+ private IdentitySchemaNode baseIdentity;
private ImmutableSet<IdentitySchemaNode> derivedIdentities;
-
- ImmutableList<UnknownSchemaNode> unknownNodes;
+ private ImmutableList<UnknownSchemaNode> unknownNodes;
public IdentityEffectiveStatementImpl(
- StmtContext<QName, IdentityStatement, EffectiveStatement<QName, IdentityStatement>> ctx) {
+ final StmtContext<QName, IdentityStatement, EffectiveStatement<QName, IdentityStatement>> ctx) {
super(ctx);
this.qname = ctx.getStatementArgument();
}
private void initDerivedIdentities(
- StmtContext<QName, IdentityStatement, EffectiveStatement<QName, IdentityStatement>> ctx) {
+ final StmtContext<QName, IdentityStatement, EffectiveStatement<QName, IdentityStatement>> ctx) {
Set<IdentitySchemaNode> derivedIdentitiesInit = new HashSet<IdentitySchemaNode>();
List<StmtContext<?, ?, ?>> derivedIdentitiesCtxList = ctx.getFromNamespace(
DerivedIdentitiesNamespace.class, ctx.getStatementArgument());
- if(derivedIdentitiesCtxList == null) {
+ if (derivedIdentitiesCtxList == null) {
this.derivedIdentities = ImmutableSet.of();
return;
}
this.derivedIdentities = ImmutableSet.copyOf(derivedIdentitiesInit);
}
- private void initBaseIdentity(IdentityEffectiveStatementImpl baseIdentity) {
+ private void initBaseIdentity(final IdentityEffectiveStatementImpl baseIdentity) {
this.baseIdentity = baseIdentity;
}
return false;
}
IdentityEffectiveStatementImpl other = (IdentityEffectiveStatementImpl) obj;
- if (qname == null) {
- if (other.qname != null) {
- return false;
- }
- } else if (!qname.equals(other.qname)) {
- return false;
- }
- if (path == null) {
- if (other.path != null) {
- return false;
- }
- } else if (!path.equals(other.path)) {
- return false;
- }
- return true;
+ return Objects.equals(qname, other.qname) && Objects.equals(path, other.path);
}
@Override
import org.opendaylight.yangtools.yang.model.api.stmt.IfFeatureStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class IfFeatureEffectiveStatementImpl extends
- EffectiveStatementBase<QName, IfFeatureStatement> {
-
- public IfFeatureEffectiveStatementImpl(
- StmtContext<QName, IfFeatureStatement, ?> ctx) {
+public class IfFeatureEffectiveStatementImpl extends EffectiveStatementBase<QName, IfFeatureStatement> {
+ public IfFeatureEffectiveStatementImpl(final StmtContext<QName, IfFeatureStatement, ?> ctx) {
super(ctx);
-
}
-
}
\ No newline at end of file
*/
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
-import org.opendaylight.yangtools.yang.common.SimpleDateFormatUtil;
-
import java.util.Date;
import java.util.Objects;
+import org.opendaylight.yangtools.yang.common.SimpleDateFormatUtil;
import org.opendaylight.yangtools.yang.model.api.ModuleImport;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.ImportStatement;
public class ImportEffectiveStatementImpl extends EffectiveStatementBase<String, ImportStatement> implements
ModuleImport {
- private String moduleName;
+ private final String moduleName;
private Date revision;
private String prefix;
- public ImportEffectiveStatementImpl(StmtContext<String, ImportStatement, ?> ctx) {
+ public ImportEffectiveStatementImpl(final StmtContext<String, ImportStatement, ?> ctx) {
super(ctx);
moduleName = ctx.getStatementArgument();
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
return false;
}
ImportEffectiveStatementImpl other = (ImportEffectiveStatementImpl) obj;
- if (getModuleName() == null) {
- if (other.getModuleName() != null) {
- return false;
- }
- } else if (!getModuleName().equals(other.getModuleName())) {
+ if (!Objects.equals(getModuleName(), other.getModuleName())) {
return false;
}
- if (getRevision() == null) {
- if (other.getRevision() != null) {
- return false;
- }
- } else if (!getRevision().equals(other.getRevision())) {
+ if (!Objects.equals(getRevision(), other.getRevision())) {
return false;
}
- if (getPrefix() == null) {
- if (other.getPrefix() != null) {
- return false;
- }
- } else if (!getPrefix().equals(other.getPrefix())) {
+ if (!Objects.equals(getPrefix(), other.getPrefix())) {
return false;
}
return true;
import org.opendaylight.yangtools.yang.model.api.stmt.IncludeStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class IncludeEffectiveStatementImpl extends
- EffectiveStatementBase<String, IncludeStatement> {
-
- public IncludeEffectiveStatementImpl(
- StmtContext<String, IncludeStatement, ?> ctx) {
+public class IncludeEffectiveStatementImpl extends EffectiveStatementBase<String, IncludeStatement> {
+ public IncludeEffectiveStatementImpl(final StmtContext<String, IncludeStatement, ?> ctx) {
super(ctx);
}
-
}
\ No newline at end of file
import org.opendaylight.yangtools.yang.model.api.AugmentationSchema;
import org.opendaylight.yangtools.yang.model.api.ConstraintDefinition;
import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.opendaylight.yangtools.yang.model.api.stmt.InputStatement;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.InputStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext.TypeOfCopy;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
private final SchemaPath path;
private final boolean presence;
- boolean augmenting;
- boolean addedByUses;
- boolean configuration = true;
- ContainerSchemaNode original;
- ConstraintDefinition constraints;
+ private boolean augmenting;
+ private boolean addedByUses;
+ private boolean configuration = true;
+ private ContainerSchemaNode original;
+ private final ConstraintDefinition constraints;
private ImmutableSet<AugmentationSchema> augmentations;
private ImmutableList<UnknownSchemaNode> unknownNodes;
public InputEffectiveStatementImpl(
- StmtContext<QName, InputStatement, EffectiveStatement<QName, InputStatement>> ctx) {
+ final StmtContext<QName, InputStatement, EffectiveStatement<QName, InputStatement>> ctx) {
super(ctx);
qname = ctx.getStatementArgument();
path = Utils.getSchemaPath(ctx);
- presence = (firstEffective(PresenceEffectiveStatementImpl.class) == null) ? false
- : true;
+ presence = firstEffective(PresenceEffectiveStatementImpl.class) != null;
this.constraints = new EffectiveConstraintDefinitionImpl(this);
initSubstatementCollectionsAndFields();
initCopyType(ctx);
}
- private void initCopyType(
- StmtContext<QName, InputStatement, EffectiveStatement<QName, InputStatement>> ctx) {
+ private void initCopyType(final StmtContext<QName, InputStatement, EffectiveStatement<QName, InputStatement>> ctx) {
List<TypeOfCopy> copyTypesFromOriginal = ctx.getCopyHistory();
-
- if(copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_AUGMENTATION)) {
+ if (copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_AUGMENTATION)) {
augmenting = true;
}
- if(copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES)) {
+ if (copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES)) {
addedByUses = true;
}
- if(copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES_AUGMENTATION)) {
+ if (copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES_AUGMENTATION)) {
addedByUses = augmenting = true;
}
AugmentationSchema augmentationSchema = (AugmentationSchema) effectiveStatement;
augmentationsInit.add(augmentationSchema);
}
- if (!configurationInit
- && effectiveStatement instanceof ConfigEffectiveStatementImpl) {
+ if (!configurationInit && effectiveStatement instanceof ConfigEffectiveStatementImpl) {
ConfigEffectiveStatementImpl configStmt = (ConfigEffectiveStatementImpl) effectiveStatement;
this.configuration = configStmt.argument();
configurationInit = true;
return false;
}
InputEffectiveStatementImpl other = (InputEffectiveStatementImpl) obj;
- if (qname == null) {
- if (other.qname != null) {
- return false;
- }
- } else if (!qname.equals(other.qname)) {
- return false;
- }
- if (path == null) {
- if (other.path != null) {
- return false;
- }
- } else if (!path.equals(other.path)) {
- return false;
- }
- return true;
+ return Objects.equals(qname, other.qname) && Objects.equals(path, other.path);
}
@Override
public String toString() {
return "RPC input " + qname.getLocalName();
}
-
}
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
import java.util.Collection;
-import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier;
-
import org.opendaylight.yangtools.yang.model.api.stmt.KeyStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class KeyEffectiveStatementImpl extends
- EffectiveStatementBase<Collection<SchemaNodeIdentifier>, KeyStatement> {
-
- public KeyEffectiveStatementImpl(
- StmtContext<Collection<SchemaNodeIdentifier>, KeyStatement, ?> ctx) {
+public class KeyEffectiveStatementImpl extends EffectiveStatementBase<Collection<SchemaNodeIdentifier>, KeyStatement> {
+ public KeyEffectiveStatementImpl(final StmtContext<Collection<SchemaNodeIdentifier>, KeyStatement, ?> ctx) {
super(ctx);
}
-
}
import org.opendaylight.yangtools.yang.model.api.ConstraintDefinition;
import org.opendaylight.yangtools.yang.model.api.DerivableSchemaNode;
import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.opendaylight.yangtools.yang.model.api.stmt.LeafStatement;
import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.LeafStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext.TypeOfCopy;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.TypeUtils;
private final QName qname;
private final SchemaPath path;
+ // FIXME: should be private
boolean augmenting;
private boolean addedByUses;
private LeafSchemaNode original;
private boolean configuration = true;
- private ConstraintDefinition constraintsDef;
+ private final ConstraintDefinition constraintsDef;
private TypeDefinition<?> type;
private String defaultStr;
private String unitsStr;
private ImmutableList<UnknownSchemaNode> unknownNodes;
- public LeafEffectiveStatementImpl(StmtContext<QName, LeafStatement, EffectiveStatement<QName, LeafStatement>> ctx) {
+ public LeafEffectiveStatementImpl(final StmtContext<QName, LeafStatement, EffectiveStatement<QName, LeafStatement>> ctx) {
super(ctx);
this.qname = ctx.getStatementArgument();
this.path = Utils.getSchemaPath(ctx);
}
private void initCopyType(
- StmtContext<QName, LeafStatement, EffectiveStatement<QName, LeafStatement>> ctx) {
+ final StmtContext<QName, LeafStatement, EffectiveStatement<QName, LeafStatement>> ctx) {
List<TypeOfCopy> copyTypesFromOriginal = ctx.getCopyHistory();
- if(copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_AUGMENTATION)) {
+ if (copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_AUGMENTATION)) {
augmenting = true;
}
- if(copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES)) {
+ if (copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES)) {
addedByUses = true;
}
- if(copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES_AUGMENTATION)) {
+ if (copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES_AUGMENTATION)) {
addedByUses = augmenting = true;
}
-
if (ctx.getOriginalCtx() != null) {
original = (LeafSchemaNode) ctx.getOriginalCtx().buildEffective();
}
return false;
}
LeafEffectiveStatementImpl other = (LeafEffectiveStatementImpl) obj;
- if (qname == null) {
- if (other.qname != null) {
- return false;
- }
- } else if (!qname.equals(other.qname)) {
- return false;
- }
- if (path == null) {
- if (other.path != null) {
- return false;
- }
- } else if (!path.equals(other.path)) {
- return false;
- }
- return true;
+ return Objects.equals(qname, other.qname) && Objects.equals(path, other.path);
}
@Override
import org.opendaylight.yangtools.yang.model.api.ConstraintDefinition;
import org.opendaylight.yangtools.yang.model.api.DerivableSchemaNode;
import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.opendaylight.yangtools.yang.model.api.stmt.LeafListStatement;
import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.LeafListStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext.TypeOfCopy;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.TypeUtils;
private final QName qname;
private final SchemaPath path;
+ // FIXME: should be private
boolean augmenting;
private boolean addedByUses;
private LeafListSchemaNode original;
private boolean configuration = true;
- private ConstraintDefinition constraintsDef;
+ private final ConstraintDefinition constraintsDef;
private TypeDefinition<?> type;
private boolean userOrdered;
private ImmutableList<UnknownSchemaNode> unknownNodes;
public LeafListEffectiveStatementImpl(
- StmtContext<QName, LeafListStatement, EffectiveStatement<QName, LeafListStatement>> ctx) {
+ final StmtContext<QName, LeafListStatement, EffectiveStatement<QName, LeafListStatement>> ctx) {
super(ctx);
this.qname = ctx.getStatementArgument();
this.path = Utils.getSchemaPath(ctx);
}
private void initCopyType(
- StmtContext<QName, LeafListStatement, EffectiveStatement<QName, LeafListStatement>> ctx) {
+ final StmtContext<QName, LeafListStatement, EffectiveStatement<QName, LeafListStatement>> ctx) {
List<TypeOfCopy> copyTypesFromOriginal = ctx.getCopyHistory();
- if(copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_AUGMENTATION)) {
+ if (copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_AUGMENTATION)) {
augmenting = true;
}
- if(copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES)) {
+ if (copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES)) {
addedByUses = true;
}
- if(copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES_AUGMENTATION)) {
+ if (copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES_AUGMENTATION)) {
addedByUses = augmenting = true;
}
return false;
}
LeafListEffectiveStatementImpl other = (LeafListEffectiveStatementImpl) obj;
- if (qname == null) {
- if (other.qname != null) {
- return false;
- }
- } else if (!qname.equals(other.qname)) {
- return false;
- }
- if (path == null) {
- if (other.path != null) {
- return false;
- }
- } else if (!path.equals(other.path)) {
- return false;
- }
- return true;
+ return Objects.equals(qname, other.qname) && Objects.equals(path, other.path);
}
@Override
import org.opendaylight.yangtools.yang.model.api.DerivableSchemaNode;
import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
import org.opendaylight.yangtools.yang.model.api.ListSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
+import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.ListStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier;
-import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext.TypeOfCopy;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
private final QName qname;
private final SchemaPath path;
+ // FIXME: should be private
boolean augmenting;
private boolean addedByUses;
- ListSchemaNode original;
- boolean configuration = true;
- ConstraintDefinition constraints;
- boolean userOrdered;
+ private ListSchemaNode original;
+ private boolean configuration = true;
+ private final ConstraintDefinition constraints;
+ private boolean userOrdered;
- ImmutableList<QName> keyDefinition;
- ImmutableSet<AugmentationSchema> augmentations;
- ImmutableList<UnknownSchemaNode> unknownNodes;
+ private ImmutableList<QName> keyDefinition;
+ private ImmutableSet<AugmentationSchema> augmentations;
+ private ImmutableList<UnknownSchemaNode> unknownNodes;
- public ListEffectiveStatementImpl(StmtContext<QName, ListStatement, EffectiveStatement<QName, ListStatement>> ctx) {
+ public ListEffectiveStatementImpl(final StmtContext<QName, ListStatement, EffectiveStatement<QName, ListStatement>> ctx) {
super(ctx);
this.qname = ctx.getStatementArgument();
this.path = Utils.getSchemaPath(ctx);
initKeyDefinition(ctx);
}
- private void initCopyType(
- StmtContext<QName, ListStatement, EffectiveStatement<QName, ListStatement>> ctx) {
+ private void initCopyType(final StmtContext<QName, ListStatement, EffectiveStatement<QName, ListStatement>> ctx) {
List<TypeOfCopy> copyTypesFromOriginal = ctx.getCopyHistory();
- if(copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_AUGMENTATION)) {
+ if (copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_AUGMENTATION)) {
augmenting = true;
}
- if(copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES)) {
+ if (copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES)) {
addedByUses = true;
}
- if(copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES_AUGMENTATION)) {
+ if (copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES_AUGMENTATION)) {
addedByUses = augmenting = true;
}
-
if (ctx.getOriginalCtx() != null) {
original = (ListSchemaNode) ctx.getOriginalCtx().buildEffective();
}
}
- private void initKeyDefinition(StmtContext<QName, ListStatement, EffectiveStatement<QName, ListStatement>> ctx) {
+ private void initKeyDefinition(final StmtContext<QName, ListStatement, EffectiveStatement<QName, ListStatement>> ctx) {
List<QName> keyDefinitionInit = new LinkedList<>();
KeyEffectiveStatementImpl keyEffectiveSubstatement = firstEffective(KeyEffectiveStatementImpl.class);
return false;
}
final ListEffectiveStatementImpl other = (ListEffectiveStatementImpl) obj;
- if (qname == null) {
- if (other.qname != null) {
- return false;
- }
- } else if (!qname.equals(other.qname)) {
- return false;
- }
- if (path == null) {
- if (other.path != null) {
- return false;
- }
- } else if (!path.equals(other.path)) {
- return false;
- }
- return true;
+ return Objects.equals(qname, other.qname) && Objects.equals(path, other.path);
}
@Override
import org.opendaylight.yangtools.yang.model.api.stmt.MandatoryStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class MandatoryEffectiveStatementImpl extends
- EffectiveStatementBase<Boolean, MandatoryStatement> {
-
- public MandatoryEffectiveStatementImpl(
- StmtContext<Boolean, MandatoryStatement, ?> ctx) {
+public class MandatoryEffectiveStatementImpl extends EffectiveStatementBase<Boolean, MandatoryStatement> {
+ public MandatoryEffectiveStatementImpl(final StmtContext<Boolean, MandatoryStatement, ?> ctx) {
super(ctx);
-
}
-
}
\ No newline at end of file
import org.opendaylight.yangtools.yang.model.api.stmt.MaxElementsStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class MaxElementsEffectiveStatementImpl extends
- EffectiveStatementBase<String, MaxElementsStatement> {
-
- public MaxElementsEffectiveStatementImpl(
- StmtContext<String, MaxElementsStatement, ?> ctx) {
+public class MaxElementsEffectiveStatementImpl extends EffectiveStatementBase<String, MaxElementsStatement> {
+ public MaxElementsEffectiveStatementImpl(final StmtContext<String, MaxElementsStatement, ?> ctx) {
super(ctx);
}
-
}
\ No newline at end of file
import org.opendaylight.yangtools.yang.model.api.stmt.MinElementsStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class MinElementsEffectiveStatementImpl extends
- EffectiveStatementBase<Integer, MinElementsStatement> {
-
- public MinElementsEffectiveStatementImpl(
- StmtContext<Integer, MinElementsStatement, ?> ctx) {
+public class MinElementsEffectiveStatementImpl extends EffectiveStatementBase<Integer, MinElementsStatement> {
+ public MinElementsEffectiveStatementImpl(final StmtContext<Integer, MinElementsStatement, ?> ctx) {
super(ctx);
-
}
-
}
\ No newline at end of file
import org.opendaylight.yangtools.yang.parser.spi.source.ModuleCtxToModuleQName;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
-public class ModuleEffectiveStatementImpl extends
- AbstractEffectiveDocumentedNode<String, ModuleStatement> implements
+public class ModuleEffectiveStatementImpl extends AbstractEffectiveDocumentedNode<String, ModuleStatement> implements
Module, Immutable {
private final QNameModule qNameModule;
super(ctx);
name = argument();
- QNameModule qNameModuleInit = ctx.getFromNamespace(
- ModuleCtxToModuleQName.class, ctx);
- qNameModule = qNameModuleInit.getRevision() == null ? QNameModule
- .create(qNameModuleInit.getNamespace(),
- SimpleDateFormatUtil.DEFAULT_DATE_REV)
+ QNameModule qNameModuleInit = ctx.getFromNamespace( ModuleCtxToModuleQName.class, ctx);
+ qNameModule = qNameModuleInit.getRevision() == null
+ ? QNameModule.create(qNameModuleInit.getNamespace(), SimpleDateFormatUtil.DEFAULT_DATE_REV)
: qNameModuleInit;
for (EffectiveStatement<?, ?> effectiveStatement : effectiveSubstatements()) {
Set<Module> submodulesInit = new HashSet<>();
List<EffectiveStatement<?, ?>> substatementsOfSubmodulesInit = new LinkedList<>();
for (ModuleIdentifier submoduleIdentifier : includedSubmodules) {
- Mutable<String, SubmoduleStatement, EffectiveStatement<String, SubmoduleStatement>> submoduleCtx = (Mutable<String, SubmoduleStatement, EffectiveStatement<String, SubmoduleStatement>>) ctx
- .getFromNamespace(SubmoduleNamespace.class, submoduleIdentifier);
+ @SuppressWarnings("unchecked")
+ Mutable<String, SubmoduleStatement, EffectiveStatement<String, SubmoduleStatement>> submoduleCtx =
+ (Mutable<String, SubmoduleStatement, EffectiveStatement<String, SubmoduleStatement>>)
+ ctx.getFromNamespace(SubmoduleNamespace.class, submoduleIdentifier);
SubmoduleEffectiveStatementImpl submodule = (SubmoduleEffectiveStatementImpl) submoduleCtx
.buildEffective();
submodulesInit.add(submodule);
mutableChildNodes.put(dataSchemaNode.getQName(), dataSchemaNode);
mutablePublicChildNodes.add(dataSchemaNode);
} else {
- throw EffectiveStmtUtils
- .createNameCollisionSourceException(ctx,
- effectiveStatement);
+ throw EffectiveStmtUtils.createNameCollisionSourceException(ctx, effectiveStatement);
}
}
if (effectiveStatement instanceof UsesNode) {
if (!mutableUses.contains(usesNode)) {
mutableUses.add(usesNode);
} else {
- throw EffectiveStmtUtils
- .createNameCollisionSourceException(ctx,
- effectiveStatement);
+ throw EffectiveStmtUtils.createNameCollisionSourceException(ctx, effectiveStatement);
}
}
if (effectiveStatement instanceof TypeDefEffectiveStatementImpl) {
if (!mutableTypeDefinitions.contains(extendedType)) {
mutableTypeDefinitions.add(extendedType);
} else {
- throw EffectiveStmtUtils
- .createNameCollisionSourceException(ctx,
- effectiveStatement);
+ throw EffectiveStmtUtils.createNameCollisionSourceException(ctx, effectiveStatement);
}
}
if (effectiveStatement instanceof GroupingDefinition) {
if (!mutableGroupings.contains(grp)) {
mutableGroupings.add(grp);
} else {
- throw EffectiveStmtUtils
- .createNameCollisionSourceException(ctx,
- effectiveStatement);
+ throw EffectiveStmtUtils.createNameCollisionSourceException(ctx, effectiveStatement);
}
}
}
this.unknownNodes = ImmutableList.copyOf(unknownNodesInit);
this.augmentations = ImmutableSet.copyOf(augmentationsInit);
- this.imports = ImmutableSet.copyOf(resolveModuleImports(importsInit,
- ctx));
+ this.imports = ImmutableSet.copyOf(resolveModuleImports(importsInit, ctx));
this.notifications = ImmutableSet.copyOf(notificationsInit);
this.rpcs = ImmutableSet.copyOf(rpcsInit);
this.deviations = ImmutableSet.copyOf(deviationsInit);
this.uses = ImmutableSet.copyOf(mutableUses);
}
- private static Set<ModuleImport> resolveModuleImports(
- final Set<ModuleImport> importsInit,
+ private static Set<ModuleImport> resolveModuleImports(final Set<ModuleImport> importsInit,
final StmtContext<String, ModuleStatement, EffectiveStatement<String, ModuleStatement>> ctx) {
Set<ModuleImport> resolvedModuleImports = new LinkedHashSet<>();
for (ModuleImport moduleImport : importsInit) {
return false;
}
ModuleEffectiveStatementImpl other = (ModuleEffectiveStatementImpl) obj;
- if (name == null) {
- if (other.name != null) {
- return false;
- }
- } else if (!name.equals(other.name)) {
+ if (!Objects.equals(name, other.name)) {
return false;
}
if (!qNameModule.equals(other.qNameModule)) {
return false;
}
- if (yangVersion == null) {
- if (other.yangVersion != null) {
- return false;
- }
- } else if (!yangVersion.equals(other.yangVersion)) {
+ if (!Objects.equals(yangVersion, other.yangVersion)) {
return false;
}
return true;
@Override
public String toString() {
- StringBuilder sb = new StringBuilder(
- ModuleEffectiveStatementImpl.class.getSimpleName());
+ StringBuilder sb = new StringBuilder(ModuleEffectiveStatementImpl.class.getSimpleName());
sb.append("[");
sb.append("name=").append(name);
sb.append(", namespace=").append(getNamespace());
import org.opendaylight.yangtools.yang.model.api.stmt.MustStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class MustEffectiveStatementImpl extends
- EffectiveStatementBase<RevisionAwareXPath, MustStatement> implements
+public class MustEffectiveStatementImpl extends EffectiveStatementBase<RevisionAwareXPath, MustStatement> implements
MustDefinition {
- private RevisionAwareXPath xPath;
+ private final RevisionAwareXPath xPath;
private String description;
private String errorAppTag;
private String errorMessage;
private String reference;
- public MustEffectiveStatementImpl(
- StmtContext<RevisionAwareXPath, MustStatement, ?> ctx) {
+ public MustEffectiveStatementImpl(final StmtContext<RevisionAwareXPath, MustStatement, ?> ctx) {
super(ctx);
initFields();
return false;
}
final MustEffectiveStatementImpl other = (MustEffectiveStatementImpl) obj;
- if (xPath == null) {
- if (other.xPath != null) {
- return false;
- }
- } else if (!xPath.equals(other.xPath)) {
+ if (!Objects.equals(xPath, other.xPath)) {
return false;
}
- if (description == null) {
- if (other.description != null) {
- return false;
- }
- } else if (!description.equals(other.description)) {
+ if (!Objects.equals(description, other.description)) {
return false;
}
- if (reference == null) {
- if (other.reference != null) {
- return false;
- }
- } else if (!reference.equals(other.reference)) {
+ if (!Objects.equals(reference,other.reference)) {
return false;
}
return true;
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
import java.net.URI;
-
import org.opendaylight.yangtools.yang.model.api.stmt.NamespaceStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
public class NamespaceEffectiveStatementImpl extends EffectiveStatementBase<URI, NamespaceStatement> {
-
- public NamespaceEffectiveStatementImpl(
- StmtContext<URI, NamespaceStatement, ?> ctx) {
+ public NamespaceEffectiveStatementImpl(final StmtContext<URI, NamespaceStatement, ?> ctx) {
super(ctx);
}
-
}
import java.util.Set;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.api.AugmentationSchema;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.NotificationDefinition;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.opendaylight.yangtools.yang.model.api.stmt.NotificationStatement;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.NotificationStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
implements NotificationDefinition {
private final QName qname;
private final SchemaPath path;
- ImmutableSet<AugmentationSchema> augmentations;
- ImmutableList<UnknownSchemaNode> unknownNodes;
+ private Set<AugmentationSchema> augmentations;
+ private List<UnknownSchemaNode> unknownNodes;
public NotificationEffectiveStatementImpl(
- StmtContext<QName, NotificationStatement, EffectiveStatement<QName, NotificationStatement>> ctx) {
+ final StmtContext<QName, NotificationStatement, EffectiveStatement<QName, NotificationStatement>> ctx) {
super(ctx);
this.qname = ctx.getStatementArgument();
this.path = Utils.getSchemaPath(ctx);
return false;
}
final NotificationEffectiveStatementImpl other = (NotificationEffectiveStatementImpl) obj;
- if (qname == null) {
- if (other.qname != null) {
- return false;
- }
- } else if (!qname.equals(other.qname)) {
- return false;
- }
- if (path == null) {
- if (other.path != null) {
- return false;
- }
- } else if (!path.equals(other.path)) {
- return false;
- }
- return true;
+ return Objects.equals(qname, other.qname) && Objects.equals(path, other.path);
}
@Override
public String toString() {
- StringBuilder sb = new StringBuilder(
- NotificationEffectiveStatementImpl.class.getSimpleName());
- sb.append("[qname=").append(qname).append(", path=").append(path)
- .append("]");
+ StringBuilder sb = new StringBuilder(NotificationEffectiveStatementImpl.class.getSimpleName());
+ sb.append("[qname=").append(qname).append(", path=").append(path).append("]");
return sb.toString();
}
}
import org.opendaylight.yangtools.yang.model.api.stmt.OrderedByStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class OrderedByEffectiveStatementImpl extends
- EffectiveStatementBase<String, OrderedByStatement> {
-
- public OrderedByEffectiveStatementImpl(
- StmtContext<String, OrderedByStatement, ?> ctx) {
+public class OrderedByEffectiveStatementImpl extends EffectiveStatementBase<String, OrderedByStatement> {
+ public OrderedByEffectiveStatementImpl(final StmtContext<String, OrderedByStatement, ?> ctx) {
super(ctx);
-
}
-
}
\ No newline at end of file
import org.opendaylight.yangtools.yang.model.api.stmt.OrganizationStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class OrganizationEffectiveStatementImpl extends
-EffectiveStatementBase<String, OrganizationStatement> {
-
- public OrganizationEffectiveStatementImpl(
- StmtContext<String, OrganizationStatement, ?> ctx) {
+public class OrganizationEffectiveStatementImpl extends EffectiveStatementBase<String, OrganizationStatement> {
+ public OrganizationEffectiveStatementImpl(final StmtContext<String, OrganizationStatement, ?> ctx) {
super(ctx);
-
}
-
}
\ No newline at end of file
import org.opendaylight.yangtools.yang.model.api.AugmentationSchema;
import org.opendaylight.yangtools.yang.model.api.ConstraintDefinition;
import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.opendaylight.yangtools.yang.model.api.stmt.OutputStatement;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.OutputStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext.TypeOfCopy;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
-public class OutputEffectiveStatementImpl extends
- AbstractEffectiveDocumentedDataNodeContainer<QName, OutputStatement>
+public class OutputEffectiveStatementImpl extends AbstractEffectiveDocumentedDataNodeContainer<QName, OutputStatement>
implements ContainerSchemaNode {
private final QName qname;
private final SchemaPath path;
private final boolean presence;
- boolean augmenting;
- boolean addedByUses;
- boolean configuration = true;
- ContainerSchemaNode original;
- ConstraintDefinition constraints;
+ private boolean augmenting;
+ private boolean addedByUses;
+ private boolean configuration = true;
+ private ContainerSchemaNode original;
+ private final ConstraintDefinition constraints;
- private ImmutableSet<AugmentationSchema> augmentations;
- private ImmutableList<UnknownSchemaNode> unknownNodes;
+ private Set<AugmentationSchema> augmentations;
+ private List<UnknownSchemaNode> unknownNodes;
public OutputEffectiveStatementImpl(
- StmtContext<QName, OutputStatement, EffectiveStatement<QName, OutputStatement>> ctx) {
+ final StmtContext<QName, OutputStatement, EffectiveStatement<QName, OutputStatement>> ctx) {
super(ctx);
qname = ctx.getStatementArgument();
path = Utils.getSchemaPath(ctx);
- presence = (firstEffective(PresenceEffectiveStatementImpl.class) == null) ? false
- : true;
+ presence = firstEffective(PresenceEffectiveStatementImpl.class) != null;
this.constraints = new EffectiveConstraintDefinitionImpl(this);
initSubstatementCollections();
}
private void initCopyType(
- StmtContext<QName, OutputStatement, EffectiveStatement<QName, OutputStatement>> ctx) {
+ final StmtContext<QName, OutputStatement, EffectiveStatement<QName, OutputStatement>> ctx) {
List<TypeOfCopy> copyTypesFromOriginal = ctx.getCopyHistory();
- if(copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_AUGMENTATION)) {
+ if (copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_AUGMENTATION)) {
augmenting = true;
}
- if(copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES)) {
+ if (copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES)) {
addedByUses = true;
}
- if(copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES_AUGMENTATION)) {
+ if (copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES_AUGMENTATION)) {
addedByUses = augmenting = true;
}
-
if (ctx.getOriginalCtx() != null) {
original = (ContainerSchemaNode) ctx.getOriginalCtx().buildEffective();
}
AugmentationSchema augmentationSchema = (AugmentationSchema) effectiveStatement;
augmentationsInit.add(augmentationSchema);
}
- if (!configurationInit
- && effectiveStatement instanceof ConfigEffectiveStatementImpl) {
+ if (!configurationInit && effectiveStatement instanceof ConfigEffectiveStatementImpl) {
ConfigEffectiveStatementImpl configStmt = (ConfigEffectiveStatementImpl) effectiveStatement;
this.configuration = configStmt.argument();
configurationInit = true;
return false;
}
OutputEffectiveStatementImpl other = (OutputEffectiveStatementImpl) obj;
- if (qname == null) {
- if (other.qname != null) {
- return false;
- }
- } else if (!qname.equals(other.qname)) {
- return false;
- }
- if (path == null) {
- if (other.path != null) {
- return false;
- }
- } else if (!path.equals(other.path)) {
- return false;
- }
- return true;
+ return Objects.equals(qname, other.qname) && Objects.equals(path, other.path);
}
@Override
import org.opendaylight.yangtools.yang.model.api.stmt.PathStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class PathEffectiveStatementImpl extends
- EffectiveStatementBase<RevisionAwareXPath, PathStatement> {
-
- public PathEffectiveStatementImpl(
- StmtContext<RevisionAwareXPath, PathStatement, ?> ctx) {
+public class PathEffectiveStatementImpl extends EffectiveStatementBase<RevisionAwareXPath, PathStatement> {
+ public PathEffectiveStatementImpl(final StmtContext<RevisionAwareXPath, PathStatement, ?> ctx) {
super(ctx);
-
}
-
}
\ No newline at end of file
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
public class PositionEffectiveStatementImpl extends EffectiveStatementBase<Long, PositionStatement> {
-
- public PositionEffectiveStatementImpl(StmtContext<Long, PositionStatement, ?> ctx) {
+ public PositionEffectiveStatementImpl(final StmtContext<Long, PositionStatement, ?> ctx) {
super(ctx);
-
}
-
}
\ No newline at end of file
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
import org.opendaylight.yangtools.yang.model.api.stmt.PrefixStatement;
-
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
public class PrefixEffectiveStatementImpl extends EffectiveStatementBase<String, PrefixStatement> {
-
- public PrefixEffectiveStatementImpl(
- StmtContext<String, PrefixStatement, ?> ctx) {
+ public PrefixEffectiveStatementImpl(final StmtContext<String, PrefixStatement, ?> ctx) {
super(ctx);
}
-
}
*/
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
-import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-
import org.opendaylight.yangtools.yang.model.api.stmt.PresenceStatement;
+import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class PresenceEffectiveStatementImpl extends EffectiveStatementBase<String, PresenceStatement> {
-
- public PresenceEffectiveStatementImpl(
- StmtContext<String, PresenceStatement, ?> ctx) {
+public class PresenceEffectiveStatementImpl extends EffectiveStatementBase<String, PresenceStatement> {
+ public PresenceEffectiveStatementImpl(final StmtContext<String, PresenceStatement, ?> ctx) {
super(ctx);
}
-
}
*/
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
-import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-
import org.opendaylight.yangtools.yang.model.api.stmt.ReferenceStatement;
+import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
public class ReferenceEffectiveStatementImpl extends EffectiveStatementBase<String, ReferenceStatement> {
-
- public ReferenceEffectiveStatementImpl(
- StmtContext<String, ReferenceStatement, ?> ctx) {
+ public ReferenceEffectiveStatementImpl(final StmtContext<String, ReferenceStatement, ?> ctx) {
super(ctx);
}
-
}
*/
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
+import com.google.common.collect.ImmutableList;
import java.util.Collection;
import java.util.LinkedList;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
-
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
-import com.google.common.collect.ImmutableList;
import java.util.List;
import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.model.api.SchemaNode;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.SchemaNode;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.RefineStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
public class RefineEffectiveStatementImpl extends
AbstractEffectiveDocumentedNode<SchemaNodeIdentifier, RefineStatement>
private final QName qname;
private final SchemaPath path;
- ImmutableList<UnknownSchemaNode> unknownNodes;
+ private List<UnknownSchemaNode> unknownNodes;
private final SchemaNode refineTargetNode;
public RefineEffectiveStatementImpl(
- StmtContext<SchemaNodeIdentifier, RefineStatement, ?> ctx) {
+ final StmtContext<SchemaNodeIdentifier, RefineStatement, ?> ctx) {
super(ctx);
qname = ctx.getStatementArgument().getLastComponent();
refineTargetNode = (SchemaNode) ctx.getEffectOfStatement().iterator().next().buildEffective();
initSubstatementCollectionsAndFields();
-
}
public SchemaNode getRefineTargetNode() {
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
public class RequireInstanceEffectiveStatementImpl extends EffectiveStatementBase<Boolean, RequireInstanceStatement> {
-
- public RequireInstanceEffectiveStatementImpl(StmtContext<Boolean, RequireInstanceStatement, ?> ctx) {
+ public RequireInstanceEffectiveStatementImpl(final StmtContext<Boolean, RequireInstanceStatement, ?> ctx) {
super(ctx);
-
}
-
}
\ No newline at end of file
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
import java.util.Date;
-
import org.opendaylight.yangtools.yang.model.api.stmt.RevisionDateStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class RevisionDateEffectiveStatementImpl extends
- EffectiveStatementBase<Date, RevisionDateStatement> {
-
- public RevisionDateEffectiveStatementImpl(
- StmtContext<Date, RevisionDateStatement, ?> ctx) {
+public class RevisionDateEffectiveStatementImpl extends EffectiveStatementBase<Date, RevisionDateStatement> {
+ public RevisionDateEffectiveStatementImpl(final StmtContext<Date, RevisionDateStatement, ?> ctx) {
super(ctx);
}
-
}
import org.opendaylight.yangtools.yang.model.api.stmt.RevisionStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class RevisionEffectiveStatementImpl extends
- EffectiveStatementBase<Date, RevisionStatement> {
-
+public class RevisionEffectiveStatementImpl extends EffectiveStatementBase<Date, RevisionStatement> {
private final String reference;
private final String description;
- public RevisionEffectiveStatementImpl(
- StmtContext<Date, RevisionStatement, ?> ctx) {
+ public RevisionEffectiveStatementImpl(final StmtContext<Date, RevisionStatement, ?> ctx) {
super(ctx);
DescriptionEffectiveStatementImpl descStmt = firstEffective(DescriptionEffectiveStatementImpl.class);
public final String getReference() {
return reference;
}
-
}
\ No newline at end of file
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.RpcDefinition;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.opendaylight.yangtools.yang.model.api.stmt.RpcStatement;
import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.RpcStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
private ContainerSchemaNode input;
private ContainerSchemaNode output;
- ImmutableSet<TypeDefinition<?>> typeDefinitions;
- ImmutableSet<GroupingDefinition> groupings;
- ImmutableList<UnknownSchemaNode> unknownNodes;
+ private Set<TypeDefinition<?>> typeDefinitions;
+ private Set<GroupingDefinition> groupings;
+ private List<UnknownSchemaNode> unknownNodes;
- public RpcEffectiveStatementImpl(StmtContext<QName, RpcStatement, EffectiveStatement<QName, RpcStatement>> ctx) {
+ public RpcEffectiveStatementImpl(final StmtContext<QName, RpcStatement, EffectiveStatement<QName, RpcStatement>> ctx) {
super(ctx);
this.qname = ctx.getStatementArgument();
this.path = Utils.getSchemaPath(ctx);
initSubstatements();
-
}
private void initSubstatements() {
return false;
}
final RpcEffectiveStatementImpl other = (RpcEffectiveStatementImpl) obj;
- if (qname == null) {
- if (other.qname != null) {
- return false;
- }
- } else if (!qname.equals(other.qname)) {
- return false;
- }
- if (path == null) {
- if (other.path != null) {
- return false;
- }
- } else if (!path.equals(other.path)) {
- return false;
- }
- return true;
+ return Objects.equals(qname, other.qname) && Objects.equals(path, other.path);
}
@Override
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
import org.opendaylight.yangtools.yang.model.api.Status;
-
import org.opendaylight.yangtools.yang.model.api.stmt.StatusStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class StatusEffectiveStatementImpl extends
- EffectiveStatementBase<Status, StatusStatement> {
-
- public StatusEffectiveStatementImpl(
- StmtContext<Status, StatusStatement, ?> ctx) {
+public class StatusEffectiveStatementImpl extends EffectiveStatementBase<Status, StatusStatement> {
+ public StatusEffectiveStatementImpl(final StmtContext<Status, StatusStatement, ?> ctx) {
super(ctx);
-
}
-
}
\ No newline at end of file
import org.opendaylight.yangtools.yang.parser.spi.source.ModuleNameToModuleQName;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
-public class SubmoduleEffectiveStatementImpl
- extends
- AbstractEffectiveDocumentedNode<String, SubmoduleStatement>
+public class SubmoduleEffectiveStatementImpl extends AbstractEffectiveDocumentedNode<String, SubmoduleStatement>
implements Module, Immutable {
private final QNameModule qNameModule;
name = argument();
- String belongsToModuleName = firstAttributeOf(
- ctx.declaredSubstatements(), BelongsToStatement.class);
+ String belongsToModuleName = firstAttributeOf(ctx.declaredSubstatements(), BelongsToStatement.class);
final QNameModule belongsToModuleQName = ctx.getFromNamespace(
ModuleNameToModuleQName.class, belongsToModuleName);
RevisionEffectiveStatementImpl submoduleRevision = firstEffective(RevisionEffectiveStatementImpl.class);
- qNameModule = submoduleRevision == null ? QNameModule.create(
- belongsToModuleQName.getNamespace(),
- SimpleDateFormatUtil.DEFAULT_DATE_REV) : QNameModule.create(
- belongsToModuleQName.getNamespace(),
- submoduleRevision.argument());
+ qNameModule = submoduleRevision == null
+ ? QNameModule.create(belongsToModuleQName.getNamespace(), SimpleDateFormatUtil.DEFAULT_DATE_REV)
+ : QNameModule.create(belongsToModuleQName.getNamespace(), submoduleRevision.argument());
for (EffectiveStatement<?, ?> effectiveStatement : effectiveSubstatements()) {
if (effectiveStatement instanceof PrefixEffectiveStatementImpl) {
- prefix = ((PrefixEffectiveStatementImpl) effectiveStatement)
- .argument();
+ prefix = ((PrefixEffectiveStatementImpl) effectiveStatement).argument();
}
if (effectiveStatement instanceof YangVersionEffectiveStatementImpl) {
- yangVersion = ((YangVersionEffectiveStatementImpl) effectiveStatement)
- .argument();
+ yangVersion = ((YangVersionEffectiveStatementImpl) effectiveStatement).argument();
}
if (effectiveStatement instanceof OrganizationEffectiveStatementImpl) {
- organization = ((OrganizationEffectiveStatementImpl) effectiveStatement)
- .argument();
+ organization = ((OrganizationEffectiveStatementImpl) effectiveStatement).argument();
}
if (effectiveStatement instanceof ContactEffectiveStatementImpl) {
- contact = ((ContactEffectiveStatementImpl) effectiveStatement)
- .argument();
+ contact = ((ContactEffectiveStatementImpl) effectiveStatement).argument();
}
}
return false;
}
SubmoduleEffectiveStatementImpl other = (SubmoduleEffectiveStatementImpl) obj;
- if (name == null) {
- if (other.name != null) {
- return false;
- }
- } else if (!name.equals(other.name)) {
+ if (!Objects.equals(name, other.name)) {
return false;
}
if (!qNameModule.equals(other.qNameModule)) {
return false;
}
- if (yangVersion == null) {
- if (other.yangVersion != null) {
- return false;
- }
- } else if (!yangVersion.equals(other.yangVersion)) {
+ if (!Objects.equals(yangVersion, other.yangVersion)) {
return false;
}
return true;
*/
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
-import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
-
-import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContextUtils;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.Decimal64SpecificationEffectiveStatementImpl;
-import java.util.ArrayList;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.LengthEffectiveStatementImpl;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.PatternEffectiveStatementImpl;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.RangeEffectiveStatementImpl;
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableList;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.TypedefStatement;
import org.opendaylight.yangtools.yang.model.api.type.LengthConstraint;
import org.opendaylight.yangtools.yang.model.api.type.PatternConstraint;
import org.opendaylight.yangtools.yang.model.util.ExtendedType.Builder;
import org.opendaylight.yangtools.yang.parser.spi.TypeNamespace;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
+import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContextUtils;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.TypeUtils;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.Decimal64SpecificationEffectiveStatementImpl;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.LengthEffectiveStatementImpl;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.PatternEffectiveStatementImpl;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.RangeEffectiveStatementImpl;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.TypeDefinitionEffectiveBuilder;
-public class TypeDefEffectiveStatementImpl extends
- EffectiveStatementBase<QName, TypedefStatement> implements
- TypeDefinition<TypeDefinition<?>>, TypeDefinitionEffectiveBuilder {
+public class TypeDefEffectiveStatementImpl extends EffectiveStatementBase<QName, TypedefStatement>
+ implements TypeDefinition<TypeDefinition<?>>, TypeDefinitionEffectiveBuilder {
private final QName qName;
private final SchemaPath path;
private ExtendedType extendedType = null;
- public TypeDefEffectiveStatementImpl(
- StmtContext<QName, TypedefStatement, ?> ctx) {
+ public TypeDefEffectiveStatementImpl(final StmtContext<QName, TypedefStatement, ?> ctx) {
super(ctx);
qName = ctx.getStatementArgument();
}
}
- private TypeDefinition<?> parseBaseTypeFromCtx(
- final StmtContext<QName, TypedefStatement, ?> ctx) {
+ private TypeDefinition<?> parseBaseTypeFromCtx(final StmtContext<QName, TypedefStatement, ?> ctx) {
TypeDefinition<?> baseType;
}
} else {
StmtContext<?, TypedefStatement, EffectiveStatement<QName, TypedefStatement>> baseTypeCtx = ctx
- .getParentContext().getFromNamespace(TypeNamespace.class,
- baseTypeQName);
- baseType = (TypeDefEffectiveStatementImpl) baseTypeCtx
- .buildEffective();
+ .getParentContext().getFromNamespace(TypeNamespace.class, baseTypeQName);
+ baseType = (TypeDefEffectiveStatementImpl) baseTypeCtx.buildEffective();
}
return baseType;
}
- protected Integer initFractionDigits(
- EffectiveStatementBase<?, ?> typeEffectiveStmt) {
+ protected Integer initFractionDigits(final EffectiveStatementBase<?, ?> typeEffectiveStmt) {
final FractionDigitsEffectiveStatementImpl fractionDigitsEffStmt = typeEffectiveStmt
.firstEffective(FractionDigitsEffectiveStatementImpl.class);
- return fractionDigitsEffStmt != null ? fractionDigitsEffStmt.argument()
- : null;
+ return fractionDigitsEffStmt != null ? fractionDigitsEffStmt.argument() : null;
}
- protected List<RangeConstraint> initRanges(
- EffectiveStatementBase<?, ?> typeEffectiveStmt) {
+ protected List<RangeConstraint> initRanges(final EffectiveStatementBase<?, ?> typeEffectiveStmt) {
final RangeEffectiveStatementImpl rangeConstraints = typeEffectiveStmt
.firstEffective(RangeEffectiveStatementImpl.class);
- return rangeConstraints != null ? rangeConstraints.argument()
- : Collections.<RangeConstraint> emptyList();
+ return rangeConstraints != null ? rangeConstraints.argument(): Collections.<RangeConstraint> emptyList();
}
- protected List<LengthConstraint> initLengths(
- EffectiveStatementBase<?, ?> typeEffectiveStmt) {
+ protected List<LengthConstraint> initLengths(final EffectiveStatementBase<?, ?> typeEffectiveStmt) {
final LengthEffectiveStatementImpl lengthConstraints = typeEffectiveStmt
.firstEffective(LengthEffectiveStatementImpl.class);
- return lengthConstraints != null ? lengthConstraints.argument()
- : Collections.<LengthConstraint> emptyList();
+ return lengthConstraints != null ? lengthConstraints.argument(): Collections.<LengthConstraint> emptyList();
}
- protected List<PatternConstraint> initPatterns(
- EffectiveStatementBase<?, ?> typeEffectiveStmt) {
+ protected List<PatternConstraint> initPatterns(final EffectiveStatementBase<?, ?> typeEffectiveStmt) {
final List<PatternConstraint> patternConstraints = new ArrayList<>();
- for (final EffectiveStatement<?, ?> effectiveStatement : typeEffectiveStmt
- .effectiveSubstatements()) {
+ for (final EffectiveStatement<?, ?> effectiveStatement : typeEffectiveStmt.effectiveSubstatements()) {
if (effectiveStatement instanceof PatternEffectiveStatementImpl) {
- final PatternConstraint pattern = ((PatternEffectiveStatementImpl) effectiveStatement)
- .argument();
-
+ final PatternConstraint pattern = ((PatternEffectiveStatementImpl) effectiveStatement).argument();
if (pattern != null) {
patternConstraints.add(pattern);
}
}
}
- return !patternConstraints.isEmpty() ? ImmutableList
- .copyOf(patternConstraints) : Collections
- .<PatternConstraint> emptyList();
+ return ImmutableList.copyOf(patternConstraints);
}
@Override
import org.opendaylight.yangtools.yang.model.api.stmt.UnitsStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class UnitsEffectiveStatementImpl extends
- EffectiveStatementBase<String, UnitsStatement> {
-
- public UnitsEffectiveStatementImpl(
- StmtContext<String, UnitsStatement, ?> ctx) {
+public class UnitsEffectiveStatementImpl extends EffectiveStatementBase<String, UnitsStatement> {
+ public UnitsEffectiveStatementImpl(final StmtContext<String, UnitsStatement, ?> ctx) {
super(ctx);
}
-
}
private ExtensionDefinition extension;
private String description;
private String reference;
- private Status status = Status.CURRENT;
+ private final Status status = Status.CURRENT;
private final List<UnknownSchemaNode> unknownNodes = new ArrayList<>();
private QName nodeType;
- private String nodeParameter;
+ private final String nodeParameter;
public UnknownEffectiveStatementImpl(final StmtContext<QName, UnknownStatement<QName>, ?> ctx) {
super(ctx);
return false;
}
UnknownEffectiveStatementImpl other = (UnknownEffectiveStatementImpl) obj;
- if (qName == null) {
- if (other.qName != null) {
- return false;
- }
- } else if (!qName.equals(other.qName)) {
+ if (!Objects.equals(qName, other.qName)) {
return false;
}
- if (path == null) {
- if (other.path != null) {
- return false;
- }
- } else if (!path.equals(other.path)) {
+ if (!Objects.equals(path, other.path)) {
return false;
}
- if (nodeType == null) {
- if (other.nodeType != null) {
- return false;
- }
- } else if (!nodeType.equals(other.nodeType)) {
+ if (!Objects.equals(nodeType, other.nodeType)) {
return false;
}
- if (nodeParameter == null) {
- if (other.nodeParameter != null) {
- return false;
- }
- } else if (!nodeParameter.equals(other.nodeParameter)) {
+ if (!Objects.equals(nodeParameter, other.nodeParameter)) {
return false;
}
return true;
public class UsesEffectiveStatementImpl extends EffectiveStatementBase<QName, UsesStatement> implements UsesNode {
private SchemaPath groupingPath;
private boolean addedByUses;
- ImmutableMap<SchemaPath, SchemaNode> refines;
- ImmutableSet<AugmentationSchema> augmentations;
- ImmutableList<UnknownSchemaNode> unknownNodes;
+ private ImmutableMap<SchemaPath, SchemaNode> refines;
+ private ImmutableSet<AugmentationSchema> augmentations;
+ private ImmutableList<UnknownSchemaNode> unknownNodes;
- public UsesEffectiveStatementImpl(StmtContext<QName, UsesStatement, EffectiveStatement<QName, UsesStatement>> ctx) {
+ public UsesEffectiveStatementImpl(final StmtContext<QName, UsesStatement, EffectiveStatement<QName, UsesStatement>> ctx) {
super(ctx);
initGroupingPath(ctx);
initSubstatementCollections();
}
- private void initGroupingPath(StmtContext<QName, UsesStatement, EffectiveStatement<QName, UsesStatement>> ctx) {
+ private void initGroupingPath(final StmtContext<QName, UsesStatement, EffectiveStatement<QName, UsesStatement>> ctx) {
StmtContext<?, GroupingStatement, EffectiveStatement<QName, GroupingStatement>> grpCtx = ctx.getFromNamespace(
GroupingNamespace.class, ctx.getStatementArgument());
this.groupingPath = Utils.getSchemaPath(grpCtx);
}
private void initCopyType(
- StmtContext<QName, UsesStatement, EffectiveStatement<QName, UsesStatement>> ctx) {
+ final StmtContext<QName, UsesStatement, EffectiveStatement<QName, UsesStatement>> ctx) {
List<TypeOfCopy> copyTypesFromOriginal = ctx.getCopyHistory();
if(copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES)) {
return false;
}
final UsesEffectiveStatementImpl other = (UsesEffectiveStatementImpl) obj;
- if (groupingPath == null) {
- if (other.groupingPath != null) {
- return false;
- }
- } else if (!groupingPath.equals(other.groupingPath)) {
- return false;
- }
- if (augmentations == null) {
- if (other.augmentations != null) {
- return false;
- }
- } else if (!augmentations.equals(other.augmentations)) {
- return false;
- }
- return true;
+ return Objects.equals(groupingPath, other.groupingPath) && Objects.equals(augmentations, other.augmentations);
}
@Override
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
public class ValueEffectiveStatementImpl extends EffectiveStatementBase<Integer, ValueStatement> {
-
- public ValueEffectiveStatementImpl(StmtContext<Integer, ValueStatement, ?> ctx) {
+ public ValueEffectiveStatementImpl(final StmtContext<Integer, ValueStatement, ?> ctx) {
super(ctx);
}
}
\ No newline at end of file
import org.opendaylight.yangtools.yang.model.api.stmt.WhenStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class WhenEffectiveStatementImpl extends
- EffectiveStatementBase<RevisionAwareXPath, WhenStatement> {
-
- public WhenEffectiveStatementImpl(
- StmtContext<RevisionAwareXPath, WhenStatement, ?> ctx) {
+public class WhenEffectiveStatementImpl extends EffectiveStatementBase<RevisionAwareXPath, WhenStatement> {
+ public WhenEffectiveStatementImpl(final StmtContext<RevisionAwareXPath, WhenStatement, ?> ctx) {
super(ctx);
-
}
-
}
\ No newline at end of file
import org.opendaylight.yangtools.yang.model.api.stmt.YangVersionStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class YangVersionEffectiveStatementImpl extends
- EffectiveStatementBase<String, YangVersionStatement> {
-
- public YangVersionEffectiveStatementImpl(
- StmtContext<String, YangVersionStatement, ?> ctx) {
+public class YangVersionEffectiveStatementImpl extends EffectiveStatementBase<String, YangVersionStatement> {
+ public YangVersionEffectiveStatementImpl(final StmtContext<String, YangVersionStatement, ?> ctx) {
super(ctx);
-
}
-
}
\ No newline at end of file
import org.opendaylight.yangtools.yang.model.api.stmt.YinElementStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-public class YinElementEffectiveStatementImpl extends
- EffectiveStatementBase<Boolean, YinElementStatement> {
-
- public YinElementEffectiveStatementImpl(
- StmtContext<Boolean, YinElementStatement, ?> ctx) {
+public class YinElementEffectiveStatementImpl extends EffectiveStatementBase<Boolean, YinElementStatement> {
+ public YinElementEffectiveStatementImpl(final StmtContext<Boolean, YinElementStatement, ?> ctx) {
super(ctx);
}
-
}
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
-public class BinaryEffectiveStatementImpl extends
- EffectiveStatementBase<String, TypeStatement> implements
- BinaryTypeDefinition {
+public class BinaryEffectiveStatementImpl extends EffectiveStatementBase<String, TypeStatement>
+ implements BinaryTypeDefinition {
private static final String DESCRIPTION = "The binary built-in type represents any binary data, i.e., a sequence of octets.";
private static final String REFERENCE = "https://tools.ietf.org/html/rfc6020#section-9.8";
final StmtContext<String, TypeStatement, EffectiveStatement<String, TypeStatement>> ctx) {
super(ctx);
- final LengthConstraint lengthConstraint = new LengthConstraintEffectiveImpl(
- 0, Long.MAX_VALUE, OPTIONAL_EMPTY, OPTIONAL_EMPTY);
+ final LengthConstraint lengthConstraint =
+ new LengthConstraintEffectiveImpl(0, Long.MAX_VALUE, OPTIONAL_EMPTY, OPTIONAL_EMPTY);
lengthConstraints = Collections.singletonList(lengthConstraint);
}
import java.util.List;
import java.util.Objects;
import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
import org.opendaylight.yangtools.yang.model.api.Status;
+import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.BitStatement;
import org.opendaylight.yangtools.yang.model.api.type.BitsTypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.DescriptionEffectiveStatementImpl;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.PositionEffectiveStatementImpl;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.ReferenceEffectiveStatementImpl;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.StatusEffectiveStatementImpl;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
public class BitEffectiveStatementImpl extends EffectiveStatementBase<QName, BitStatement> implements
BitsTypeDefinition.Bit {
private String description;
private String reference;
private Status status;
- private List<UnknownSchemaNode> unknownSchemaNodes;
+ private final List<UnknownSchemaNode> unknownSchemaNodes;
- public BitEffectiveStatementImpl(StmtContext<QName, BitStatement, ?> ctx) {
+ public BitEffectiveStatementImpl(final StmtContext<QName, BitStatement, ?> ctx) {
super(ctx);
List<UnknownSchemaNode> unknownSchemaNodesInit = new ArrayList<>();
return false;
}
BitsTypeDefinition.Bit other = (BitsTypeDefinition.Bit) obj;
- if (qName == null) {
- if (other.getQName() != null) {
- return false;
- }
- } else if (!qName.equals(other.getQName())) {
- return false;
- }
- if (schemaPath == null) {
- if (other.getPath() != null) {
- return false;
- }
- } else if (!schemaPath.equals(other.getPath())) {
- return false;
- }
- return true;
+ return Objects.equals(qName, other.getQName()) && Objects.equals(schemaPath, other.getPath());
}
@Override
import java.util.List;
import java.util.Objects;
import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
import org.opendaylight.yangtools.yang.model.api.Status;
-import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
-import org.opendaylight.yangtools.yang.model.api.type.BitsTypeDefinition;
import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.model.api.type.BitsTypeDefinition;
import org.opendaylight.yangtools.yang.model.util.BaseTypes;
import org.opendaylight.yangtools.yang.model.util.BitsType;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
public class BitsSpecificationEffectiveStatementImpl extends
EffectiveStatementBase<String, TypeStatement.BitsSpecification> implements BitsTypeDefinition, TypeDefinitionEffectiveBuilder {
private final SchemaPath path;
private final List<Bit> bits;
- public BitsSpecificationEffectiveStatementImpl(StmtContext<String, TypeStatement.BitsSpecification, EffectiveStatement<String, TypeStatement.BitsSpecification>> ctx) {
+ public BitsSpecificationEffectiveStatementImpl(final StmtContext<String, TypeStatement.BitsSpecification, EffectiveStatement<String, TypeStatement.BitsSpecification>> ctx) {
super(ctx);
List<Bit> bitsInit = new ArrayList<>();
return false;
}
BitsSpecificationEffectiveStatementImpl other = (BitsSpecificationEffectiveStatementImpl) obj;
- if (bits == null) {
- if (other.bits != null) {
- return false;
- }
- } else if (!bits.equals(other.bits)) {
- return false;
- }
- if (path == null) {
- if (other.path != null) {
- return false;
- }
- } else if (!path.equals(other.path)) {
- return false;
- }
- return true;
+ return Objects.equals(bits, other.bits) && Objects.equals(path, other.path);
}
@Override
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type;
-import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
-
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
import java.util.Collections;
import java.util.List;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.api.Status;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
import org.opendaylight.yangtools.yang.model.api.type.BooleanTypeDefinition;
import org.opendaylight.yangtools.yang.model.util.BaseTypes;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.TypeUtils;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
-public class BooleanEffectiveStatementImpl
- extends EffectiveStatementBase<String, TypeStatement> implements
- BooleanTypeDefinition {
+public class BooleanEffectiveStatementImpl extends EffectiveStatementBase<String, TypeStatement>
+ implements BooleanTypeDefinition {
public static final String LOCAL_NAME = TypeUtils.BOOLEAN;
- private static final QName QNAME = QName.create(
- YangConstants.RFC6020_YANG_MODULE, LOCAL_NAME);
+ private static final QName QNAME = QName.create(YangConstants.RFC6020_YANG_MODULE, LOCAL_NAME);
private static final SchemaPath PATH = SchemaPath.create(true, QNAME);
private static final String DESCRIPTION = "The boolean built-in type represents a boolean value.";
private static final String REFERENCE = "https://tools.ietf.org/html/rfc6020#section-9.5";
private static final String UNITS = "";
public BooleanEffectiveStatementImpl(
- StmtContext<String, TypeStatement, EffectiveStatement<String, TypeStatement>> ctx) {
+ final StmtContext<String, TypeStatement, EffectiveStatement<String, TypeStatement>> ctx) {
super(ctx);
-
}
@Override
private ExtendedType extendedType;
private final boolean isExtended;
+ private Decimal64 decimal64Instance = null;
public Decimal64SpecificationEffectiveStatementImpl(
final StmtContext<String, TypeStatement.Decimal64Specification, EffectiveStatement<String, TypeStatement.Decimal64Specification>> ctx) {
return false;
}
Decimal64SpecificationEffectiveStatementImpl other = (Decimal64SpecificationEffectiveStatementImpl) obj;
- if (path == null) {
- if (other.path != null) {
- return false;
- }
- } else if (!path.equals(other.path)) {
- return false;
- }
- return true;
+ return Objects.equals(path, other.path);
}
@Override
public String toString() {
return Decimal64SpecificationEffectiveStatementImpl.class
.getSimpleName()
- + "[qName="
- + QNAME
- + ", fractionDigits="
- + fractionDigits + "]";
+ + "[qName=" + QNAME
+ + ", fractionDigits=" + fractionDigits + "]";
}
- private Decimal64 decimal64Instance = null;
-
@Override
public TypeDefinition<?> buildType() {
decimal64Instance = Decimal64.create(path, fractionDigits);
}
- if(!isExtended) {
+ if (!isExtended) {
return decimal64Instance;
}
return extendedType;
}
- Builder extendedTypeBuilder = ExtendedType.builder(path.getLastComponent(), decimal64Instance, Optional.<String>absent(),
- Optional.<String>absent(), path);
+ Builder extendedTypeBuilder = ExtendedType.builder(path.getLastComponent(), decimal64Instance,
+ Optional.<String>absent(), Optional.<String>absent(), path);
extendedTypeBuilder.fractionDigits(fractionDigits);
extendedTypeBuilder.ranges(rangeConstraints);
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type;
-import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
-
import java.util.Collections;
import java.util.List;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.api.Status;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
import org.opendaylight.yangtools.yang.model.api.type.EmptyTypeDefinition;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.TypeUtils;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
-public class EmptyEffectiveStatementImpl extends
- EffectiveStatementBase<String, TypeStatement> implements
- EmptyTypeDefinition {
+public class EmptyEffectiveStatementImpl extends EffectiveStatementBase<String, TypeStatement>
+ implements EmptyTypeDefinition {
public static final String LOCAL_NAME = TypeUtils.EMPTY;
- private static final QName QNAME = QName.create(
- YangConstants.RFC6020_YANG_MODULE, LOCAL_NAME);
+ private static final QName QNAME = QName.create(YangConstants.RFC6020_YANG_MODULE, LOCAL_NAME);
private static final SchemaPath PATH = SchemaPath.create(true, QNAME);
private static final String DESCRIPTION = "The empty built-in type represents a leaf that does not have any value, it conveys information by its presence or absence.";
private static final String REFERENCE = "https://tools.ietf.org/html/rfc6020#page-131";
public EmptyEffectiveStatementImpl(
- StmtContext<String, TypeStatement, EffectiveStatement<String, TypeStatement>> ctx) {
+ final StmtContext<String, TypeStatement, EffectiveStatement<String, TypeStatement>> ctx) {
super(ctx);
-
}
@Override
import java.util.Collections;
import java.util.List;
-
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
import org.opendaylight.yangtools.yang.model.api.Status;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.EnumStatement;
-import org.opendaylight.yangtools.yang.model.api.type.EnumTypeDefinition;
+import org.opendaylight.yangtools.yang.model.api.type.EnumTypeDefinition.EnumPair;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.DescriptionEffectiveStatementImpl;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.StatusEffectiveStatementImpl;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.ValueEffectiveStatementImpl;
-public class EnumEffectiveStatementImpl extends EffectiveStatementBase<QName, EnumStatement> implements
- EnumTypeDefinition.EnumPair {
-
- private QName qName;
- private SchemaPath path;
+public class EnumEffectiveStatementImpl extends EffectiveStatementBase<QName, EnumStatement> implements EnumPair {
+ private final QName qName;
+ private final SchemaPath path;
private String description;
private String reference;
private Status status;
private Integer value;
- public EnumEffectiveStatementImpl(StmtContext<QName, EnumStatement, ?> ctx) {
+ public EnumEffectiveStatementImpl(final StmtContext<QName, EnumStatement, ?> ctx) {
super(ctx);
qName = ctx.getStatementArgument();
return false;
}
EnumSpecificationEffectiveStatementImpl other = (EnumSpecificationEffectiveStatementImpl) obj;
- if (defaultEnum == null) {
- if (other.defaultEnum != null) {
- return false;
- }
- } else if (!defaultEnum.equals(other.defaultEnum)) {
+ if (!Objects.equals(defaultEnum, other.defaultEnum)) {
return false;
}
- if (enums == null) {
- if (other.enums != null) {
- return false;
- }
- } else if (!enums.equals(other.enums)) {
+ if (!Objects.equals(enums, other.enums)) {
return false;
}
- if (path == null) {
- if (other.path != null) {
- return false;
- }
- } else if (!path.equals(other.path)) {
+ if (!Objects.equals(path, other.path)) {
return false;
}
return true;
@Override
public TypeDefinition<?> buildType() {
- if(enumerationTypeInstance !=null) {
+ if (enumerationTypeInstance !=null) {
return enumerationTypeInstance;
}
@Override
public String toString() {
- return "type " + qName;
+ return "type " + getQName();
}
}
@Override
public String toString() {
- return "type " + qName;
+ return "type " + getQName();
}
}
@Override
public String toString() {
- return "type " + qName;
+ return "type " + getQName();
}
}
@Override
public String toString() {
- return "type " + qName;
+ return "type " + getQName();
}
}
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type;
-import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
-
import com.google.common.base.Optional;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.YangConstants;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
import org.opendaylight.yangtools.yang.model.api.Status;
+import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
import org.opendaylight.yangtools.yang.model.api.type.IntegerTypeDefinition;
import org.opendaylight.yangtools.yang.model.api.type.RangeConstraint;
-import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
abstract class IntegerEffectiveImplBase extends
EffectiveStatementBase<String,TypeStatement> implements IntegerTypeDefinition {
private static final String REFERENCE_INT = "https://tools.ietf.org/html/rfc6020#section-9.2";
- protected QName qName;
- private SchemaPath path;
- private String units = "";
+ private final QName qName;
+ private final SchemaPath path;
+ private final String units = "";
private final String description;
- private List<RangeConstraint> rangeStatements;
+ private final List<RangeConstraint> rangeStatements;
protected IntegerEffectiveImplBase(final StmtContext<String, TypeStatement, EffectiveStatement<String, TypeStatement>> ctx,
final String localName, final Number minRange, final Number maxRange, final String description) {
return false;
}
IntegerEffectiveImplBase other = (IntegerEffectiveImplBase) obj;
- if (description == null) {
- if (other.description != null) {
- return false;
- }
- } else if (!description.equals(other.description)) {
+ if (!Objects.equals(description, other.description)) {
return false;
}
- if (qName == null) {
- if (other.qName != null) {
- return false;
- }
- } else if (!qName.equals(other.qName)) {
+ if (!Objects.equals(qName, other.qName)) {
return false;
}
- if (path == null) {
- if (other.path != null) {
- return false;
- }
- } else if (!path.equals(other.path)) {
+ if (!Objects.equals(path, other.path)) {
return false;
}
- if (rangeStatements == null) {
- if (other.rangeStatements != null) {
- return false;
- }
- } else if (!rangeStatements.equals(other.rangeStatements)) {
+ if (!Objects.equals(rangeStatements, other.rangeStatements)) {
return false;
}
- if (units == null) {
- if (other.units != null) {
- return false;
- }
- } else if (!units.equals(other.units)) {
+ if (!Objects.equals(units, other.units)) {
return false;
}
return true;
import java.util.Objects;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.YangConstants;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.RevisionAwareXPath;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
import org.opendaylight.yangtools.yang.model.api.Status;
+import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
import org.opendaylight.yangtools.yang.model.api.type.LeafrefTypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
import org.opendaylight.yangtools.yang.model.util.Leafref;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.PathEffectiveStatementImpl;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
public class LeafrefSpecificationEffectiveStatementImpl extends
EffectiveStatementBase<String, TypeStatement.LeafrefSpecification> implements LeafrefTypeDefinition, TypeDefinitionEffectiveBuilder {
private static final String REFERENCE = "https://tools.ietf.org/html/rfc6020#section-9.9";
private static final String UNITS = "";
- private RevisionAwareXPath xpath;
private final SchemaPath path;
+ private RevisionAwareXPath xpath;
+ private Leafref leafrefInstance = null;
- public LeafrefSpecificationEffectiveStatementImpl(StmtContext<String, TypeStatement.LeafrefSpecification, EffectiveStatement<String, TypeStatement.LeafrefSpecification>> ctx) {
+ public LeafrefSpecificationEffectiveStatementImpl(final StmtContext<String, TypeStatement.LeafrefSpecification, EffectiveStatement<String, TypeStatement.LeafrefSpecification>> ctx) {
super(ctx);
path = Utils.getSchemaPath(ctx.getParentContext()).createChild(QNAME);
return false;
}
LeafrefSpecificationEffectiveStatementImpl other = (LeafrefSpecificationEffectiveStatementImpl) obj;
- if (xpath == null) {
- if (other.xpath != null) {
- return false;
- }
- } else if (!xpath.equals(other.xpath)) {
- return false;
- }
- return true;
+ return Objects.equals(xpath, other.xpath);
}
@Override
return builder.toString();
}
- private Leafref leafrefInstance = null;
-
@Override
public Leafref buildType() {
return false;
}
final LengthConstraintEffectiveImpl other = (LengthConstraintEffectiveImpl) obj;
- if (description == null) {
- if (other.description != null) {
- return false;
- }
- } else if (!description.equals(other.description)) {
+ if (!Objects.equals(description, other.description)) {
return false;
}
- if (errorAppTag == null) {
- if (other.errorAppTag != null) {
- return false;
- }
- } else if (!errorAppTag.equals(other.errorAppTag)) {
+ if (!Objects.equals(errorAppTag, other.errorAppTag)) {
return false;
}
- if (errorMessage == null) {
- if (other.errorMessage != null) {
- return false;
- }
- } else if (!errorMessage.equals(other.errorMessage)) {
+ if (!Objects.equals(errorMessage, other.errorMessage)) {
return false;
}
if (!Objects.equals(max, other.max)) {
if (!Objects.equals(min, other.min)) {
return false;
}
- if (reference == null) {
- if (other.reference != null) {
- return false;
- }
- } else if (!reference.equals(other.reference)) {
+ if (!Objects.equals(reference, other.reference)) {
return false;
}
return true;
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type;
import java.util.List;
-
import org.opendaylight.yangtools.yang.model.api.stmt.LengthStatement;
import org.opendaylight.yangtools.yang.model.api.type.LengthConstraint;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
public class LengthEffectiveStatementImpl extends EffectiveStatementBase<List<LengthConstraint>, LengthStatement> {
-
- public LengthEffectiveStatementImpl(StmtContext<List<LengthConstraint>, LengthStatement, ?> ctx) {
+ public LengthEffectiveStatementImpl(final StmtContext<List<LengthConstraint>, LengthStatement, ?> ctx) {
super(ctx);
-
}
-
}
\ No newline at end of file
return false;
}
final PatternConstraintEffectiveImpl other = (PatternConstraintEffectiveImpl) obj;
- if (description == null) {
- if (other.description != null) {
- return false;
- }
- } else if (!description.equals(other.description)) {
+ if (!Objects.equals(description, other.description)) {
return false;
}
- if (errorAppTag == null) {
- if (other.errorAppTag != null) {
- return false;
- }
- } else if (!errorAppTag.equals(other.errorAppTag)) {
+ if (!Objects.equals(errorAppTag, other.errorAppTag)) {
return false;
}
- if (errorMessage == null) {
- if (other.errorMessage != null) {
- return false;
- }
- } else if (!errorMessage.equals(other.errorMessage)) {
+ if (!Objects.equals(errorMessage, other.errorMessage)) {
return false;
}
- if (reference == null) {
- if (other.reference != null) {
- return false;
- }
- } else if (!reference.equals(other.reference)) {
+ if (!Objects.equals(reference, other.reference)) {
return false;
}
- if (regEx == null) {
- if (other.regEx != null) {
- return false;
- }
- } else if (!regEx.equals(other.regEx)) {
+ if (!Objects.equals(regEx, other.regEx)) {
return false;
}
return true;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
public class PatternEffectiveStatementImpl extends EffectiveStatementBase<PatternConstraint, PatternStatement> {
-
- public PatternEffectiveStatementImpl(StmtContext<PatternConstraint, PatternStatement, ?> ctx) {
+ public PatternEffectiveStatementImpl(final StmtContext<PatternConstraint, PatternStatement, ?> ctx) {
super(ctx);
-
}
}
\ No newline at end of file
return false;
}
final RangeConstraintEffectiveImpl other = (RangeConstraintEffectiveImpl) obj;
- if (description == null) {
- if (other.description != null) {
- return false;
- }
- } else if (!description.equals(other.description)) {
+ if (!Objects.equals(description, other.description)) {
return false;
}
- if (max == null) {
- if (other.max != null) {
- return false;
- }
- } else if (!max.equals(other.max)) {
+ if (!Objects.equals(max, other.max)) {
return false;
}
- if (min == null) {
- if (other.min != null) {
- return false;
- }
- } else if (!min.equals(other.min)) {
+ if (!Objects.equals(min, other.min)) {
return false;
}
- if (reference == null) {
- if (other.reference != null) {
- return false;
- }
- } else if (!reference.equals(other.reference)) {
+ if (!Objects.equals(reference, other.reference)) {
return false;
}
return true;
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type;
import java.util.List;
-
import org.opendaylight.yangtools.yang.model.api.stmt.RangeStatement;
import org.opendaylight.yangtools.yang.model.api.type.RangeConstraint;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
public class RangeEffectiveStatementImpl extends EffectiveStatementBase<List<RangeConstraint>, RangeStatement> {
-
- public RangeEffectiveStatementImpl(StmtContext<List<RangeConstraint>, RangeStatement, ?> ctx) {
+ public RangeEffectiveStatementImpl(final StmtContext<List<RangeConstraint>, RangeStatement, ?> ctx) {
super(ctx);
}
}
return false;
}
StringEffectiveStatementImpl other = (StringEffectiveStatementImpl) obj;
- if (lengthConstraints == null) {
- if (other.lengthConstraints != null) {
- return false;
- }
- } else if (!lengthConstraints.equals(other.lengthConstraints)) {
+ if (!Objects.equals(lengthConstraints, other.lengthConstraints)) {
return false;
}
- if (patternConstraints == null) {
- if (other.patternConstraints != null) {
- return false;
- }
- } else if (!patternConstraints.equals(other.patternConstraints)) {
+ if (!Objects.equals(patternConstraints, other.patternConstraints)) {
return false;
}
return true;
*/
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type;
-import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement.StringRestrictions;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
-public class StringRestrictionsEffectiveStatementImpl extends
- EffectiveStatementBase<String, TypeStatement.StringRestrictions> {
-
- public StringRestrictionsEffectiveStatementImpl(StmtContext<String, TypeStatement.StringRestrictions, ?> ctx) {
+public class StringRestrictionsEffectiveStatementImpl extends EffectiveStatementBase<String, StringRestrictions> {
+ public StringRestrictionsEffectiveStatementImpl(final StmtContext<String, StringRestrictions, ?> ctx) {
super(ctx);
}
}
@Override
public String toString() {
- return "type " + qName;
+ return "type " + getQName();
}
}
@Override
public String toString() {
- return "type " + qName;
+ return "type " + getQName();
}
}
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type;
import java.math.BigInteger;
-
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
@Override
public String toString() {
- return "type " + qName;
+ return "type " + getQName();
}
}
@Override
public String toString() {
- return "type " + qName;
+ return "type " + getQName();
}
}
import java.util.Objects;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.YangConstants;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
import org.opendaylight.yangtools.yang.model.api.Status;
+import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
import org.opendaylight.yangtools.yang.model.api.type.RangeConstraint;
import org.opendaylight.yangtools.yang.model.api.type.UnsignedIntegerTypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
abstract class UnsignedIntegerEffectiveImplBase extends
EffectiveStatementBase<String, TypeStatement> implements UnsignedIntegerTypeDefinition {
private static final String REFERENCE_INT = "https://tools.ietf.org/html/rfc6020#section-9.2";
protected static final Number MIN_RANGE = 0;
- protected QName qName;
- private SchemaPath path;
- private String units = "";
+ private final QName qName;
+ private final SchemaPath path;
+ private final String units = "";
private final String description;
- private List<RangeConstraint> rangeStatements;
+ private final List<RangeConstraint> rangeStatements;
protected UnsignedIntegerEffectiveImplBase(final StmtContext<String, TypeStatement, EffectiveStatement<String, TypeStatement>> ctx,
final String localName, final Number maxRange, final String description) {
return false;
}
UnsignedIntegerEffectiveImplBase other = (UnsignedIntegerEffectiveImplBase) obj;
- if (description == null) {
- if (other.description != null) {
- return false;
- }
- } else if (!description.equals(other.description)) {
+ if (!Objects.equals(description, other.description)) {
return false;
}
- if (qName == null) {
- if (other.qName != null) {
- return false;
- }
- } else if (!qName.equals(other.qName)) {
+ if (!Objects.equals(qName, other.qName)) {
return false;
}
- if (path == null) {
- if (other.path != null) {
- return false;
- }
- } else if (!path.equals(other.path)) {
+ if (!Objects.equals(path, other.path)) {
return false;
}
- if (rangeStatements == null) {
- if (other.rangeStatements != null) {
- return false;
- }
- } else if (!rangeStatements.equals(other.rangeStatements)) {
+ if (!Objects.equals(rangeStatements, other.rangeStatements)) {
return false;
}
- if (units == null) {
- if (other.units != null) {
- return false;
- }
- } else if (!units.equals(other.units)) {
+ if (!Objects.equals(units, other.units)) {
return false;
}
return true;