import java.util.List;
import java.util.Objects;
import org.opendaylight.yangtools.concepts.Immutable;
+import org.opendaylight.yangtools.yang.model.api.DeviateDefinition;
import org.opendaylight.yangtools.yang.model.api.Deviation;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
public class DeviationEffectiveStatementImpl extends DeclaredEffectiveStatementBase<SchemaNodeIdentifier, DeviationStatement>
implements Deviation, Immutable {
private final SchemaPath targetPath;
- private final Deviate deviate;
+ private final String description;
private final String reference;
private final List<UnknownSchemaNode> unknownSchemaNodes;
+ private final List<DeviateDefinition> deviateDefinitions;
public DeviationEffectiveStatementImpl(final StmtContext<SchemaNodeIdentifier, DeviationStatement, ?> ctx) {
super(ctx);
this.targetPath = ctx.getStatementArgument().asSchemaPath();
- DeviateEffectiveStatementImpl deviateStmt = firstEffective(DeviateEffectiveStatementImpl.class);
- this.deviate = (deviateStmt == null) ? null : deviateStmt.argument();
+ this.deviateDefinitions = ImmutableList.copyOf(allSubstatementsOfType(DeviateDefinition.class));
+
+ DescriptionEffectiveStatementImpl descriptionStmt = firstEffective(DescriptionEffectiveStatementImpl.class);
+ this.description = (descriptionStmt == null) ? null : descriptionStmt.argument();
ReferenceEffectiveStatementImpl referenceStmt = firstEffective(ReferenceEffectiveStatementImpl.class);
this.reference = (referenceStmt == null) ? null : referenceStmt.argument();
}
@Override
- public Deviate getDeviate() {
- return deviate;
+ public List<DeviateDefinition> getDeviates() {
+ return deviateDefinitions;
+ }
+
+ @Override
+ public String getDescription() {
+ return description;
}
@Override
final int prime = 31;
int result = 1;
result = prime * result + Objects.hashCode(targetPath);
- result = prime * result + Objects.hashCode(deviate);
+ result = prime * result + Objects.hashCode(deviateDefinitions);
+ result = prime * result + Objects.hashCode(description);
result = prime * result + Objects.hashCode(reference);
return result;
}
if (!Objects.equals(targetPath, other.targetPath)) {
return false;
}
- if (!Objects.equals(deviate, other.deviate)) {
+ if (!Objects.equals(deviateDefinitions, other.deviateDefinitions)) {
+ return false;
+ }
+ if (!Objects.equals(description, other.description)) {
return false;
}
if (!Objects.equals(reference, other.reference)) {
public String toString() {
return DeviationEffectiveStatementImpl.class.getSimpleName() + "[" +
"targetPath=" + targetPath +
- ", deviate=" + deviate +
+ ", deviates=" + deviateDefinitions +
+ ", description=" + description +
", reference=" + reference +
"]";
}