final class DefValEffectiveStatementImpl extends UnknownEffectiveStatementBase<String, DefValStatement>
implements DefValEffectiveStatement, DefValSchemaNode {
-
private final SchemaPath path;
- DefValEffectiveStatementImpl(final StmtContext<String, DefValStatement, ?> ctx,
- final ImmutableList<? extends EffectiveStatement<?, ?>> substatements) {
- super(ctx, substatements);
- path = ctx.getParentContext().getSchemaPath().get().createChild(getNodeType());
+ DefValEffectiveStatementImpl(final DefValStatement declared,
+ final ImmutableList<? extends EffectiveStatement<?, ?>> substatements,
+ final StmtContext<String, DefValStatement, ?> ctx) {
+ super(ctx.coerceStatementArgument(), declared, substatements, ctx);
+ path = ctx.coerceParentContext().getSchemaPath().get().createChild(getNodeType());
}
@Override
if (this == obj) {
return true;
}
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
+ if (!(obj instanceof DefValEffectiveStatementImpl)) {
return false;
}
final DefValEffectiveStatementImpl other = (DefValEffectiveStatementImpl) obj;
- if (!Objects.equals(path, other.path)) {
- return false;
- }
- if (!Objects.equals(getNodeType(), other.getNodeType())) {
- return false;
- }
- if (!Objects.equals(getNodeParameter(), other.getNodeParameter())) {
- return false;
- }
- return true;
+ return Objects.equals(getNodeType(), other.getNodeType())
+ && Objects.equals(getNodeParameter(), other.getNodeParameter()) && Objects.equals(path, other.path);
}
}