//Generated by lombok.ast.template.TemplateProcessor. DO NOT EDIT, DO NOT CHECK IN!

package lombok.ast;

public class SuperConstructorInvocation extends lombok.ast.AbstractNode implements lombok.ast.Statement {
	private lombok.ast.AbstractNode qualifier = null;
	lombok.ast.ListAccessor<TypeReference, lombok.ast.SuperConstructorInvocation> constructorTypeArguments = ListAccessor.of(this, TypeReference.class, "SuperConstructorInvocation.constructorTypeArguments");
	lombok.ast.ListAccessor<Expression, lombok.ast.SuperConstructorInvocation> arguments = ListAccessor.of(this, Expression.class, "SuperConstructorInvocation.arguments");
	
	public Block upToBlock() {
		if (!(this.getParent() instanceof Block)) return null;
		Block out = (Block)this.getParent();
		if (!out.rawContents().contains(this)) return null;
		return out;
	}
	
	
	public Expression astQualifier() {
		if (!(this.qualifier instanceof Expression)) return null;
		return (Expression) this.qualifier;
	}
	
	public lombok.ast.SuperConstructorInvocation astQualifier(Expression qualifier) {
		return this.rawQualifier(qualifier);
	}
	
	public lombok.ast.Node rawQualifier() {
		return this.qualifier;
	}
	
	public lombok.ast.SuperConstructorInvocation rawQualifier(lombok.ast.Node qualifier) {
		if (qualifier == this.qualifier) return this;
		if (qualifier != null) this.adopt((lombok.ast.AbstractNode)qualifier);
		if (this.qualifier != null) this.disown(this.qualifier);
		this.qualifier = (lombok.ast.AbstractNode)qualifier;
		return this;
	}
	
	public lombok.ast.RawListAccessor<TypeReference, lombok.ast.SuperConstructorInvocation> rawConstructorTypeArguments() {
		return this.constructorTypeArguments.asRaw();
	}
	
	public lombok.ast.StrictListAccessor<TypeReference, lombok.ast.SuperConstructorInvocation> astConstructorTypeArguments() {
		return this.constructorTypeArguments.asStrict();
	}
	
	public lombok.ast.RawListAccessor<Expression, lombok.ast.SuperConstructorInvocation> rawArguments() {
		return this.arguments.asRaw();
	}
	
	public lombok.ast.StrictListAccessor<Expression, lombok.ast.SuperConstructorInvocation> astArguments() {
		return this.arguments.asStrict();
	}
	
	@java.lang.Override public java.util.List<Node> getChildren() {
		java.util.List<Node> result = new java.util.ArrayList<Node>();
		if (this.qualifier != null) result.add(this.qualifier);
		result.addAll(this.constructorTypeArguments.backingList());
		result.addAll(this.arguments.backingList());
		return result;
	}
	
	@java.lang.Override public boolean replaceChild(Node original, Node replacement) throws lombok.ast.AstException {
		if (this.qualifier == original) {
			this.rawQualifier(replacement);
			return true;
		}
		if (this.rawConstructorTypeArguments().replace(original, replacement)) return true;
		if (this.rawArguments().replace(original, replacement)) return true;
		return false;
	}
	
	@java.lang.Override public boolean detach(Node child) {
		if (this.qualifier == child) {
			this.disown((AbstractNode) child);
			this.qualifier = null;
			return true;
		}
		if (this.rawConstructorTypeArguments().remove(child)) return true;
		if (this.rawArguments().remove(child)) return true;
		return false;
	}
	
	@java.lang.Override public void accept(lombok.ast.AstVisitor visitor) {
		if (visitor.visitSuperConstructorInvocation(this)) return;
		if (this.qualifier != null) this.qualifier.accept(visitor);
		for (lombok.ast.Node child : this.constructorTypeArguments.asIterable()) {
			child.accept(visitor);
		}
		for (lombok.ast.Node child : this.arguments.asIterable()) {
			child.accept(visitor);
		}
		visitor.afterVisitSuperConstructorInvocation(this);
		visitor.endVisit(this);
	}
	
	@java.lang.Override public SuperConstructorInvocation copy() {
		SuperConstructorInvocation result = new SuperConstructorInvocation();
		if (this.qualifier != null) result.rawQualifier(this.qualifier.copy());
		for (Node n : this.constructorTypeArguments.backingList()) {
			result.rawConstructorTypeArguments().addToEnd(n == null ? null : n.copy());
		}
		for (Node n : this.arguments.backingList()) {
			result.rawArguments().addToEnd(n == null ? null : n.copy());
		}
		return result;
	}
	
}
