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

package lombok.ast;

public class AlternateConstructorInvocation extends lombok.ast.AbstractNode implements lombok.ast.Statement {
	lombok.ast.ListAccessor<TypeReference, lombok.ast.AlternateConstructorInvocation> constructorTypeArguments = ListAccessor.of(this, TypeReference.class, "AlternateConstructorInvocation.constructorTypeArguments");
	lombok.ast.ListAccessor<Expression, lombok.ast.AlternateConstructorInvocation> arguments = ListAccessor.of(this, Expression.class, "AlternateConstructorInvocation.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 lombok.ast.RawListAccessor<TypeReference, lombok.ast.AlternateConstructorInvocation> rawConstructorTypeArguments() {
		return this.constructorTypeArguments.asRaw();
	}
	
	public lombok.ast.StrictListAccessor<TypeReference, lombok.ast.AlternateConstructorInvocation> astConstructorTypeArguments() {
		return this.constructorTypeArguments.asStrict();
	}
	
	public lombok.ast.RawListAccessor<Expression, lombok.ast.AlternateConstructorInvocation> rawArguments() {
		return this.arguments.asRaw();
	}
	
	public lombok.ast.StrictListAccessor<Expression, lombok.ast.AlternateConstructorInvocation> astArguments() {
		return this.arguments.asStrict();
	}
	
	@java.lang.Override public java.util.List<Node> getChildren() {
		java.util.List<Node> result = new java.util.ArrayList<Node>();
		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.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.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.visitAlternateConstructorInvocation(this)) return;
		for (lombok.ast.Node child : this.constructorTypeArguments.asIterable()) {
			child.accept(visitor);
		}
		for (lombok.ast.Node child : this.arguments.asIterable()) {
			child.accept(visitor);
		}
		visitor.afterVisitAlternateConstructorInvocation(this);
		visitor.endVisit(this);
	}
	
	@java.lang.Override public AlternateConstructorInvocation copy() {
		AlternateConstructorInvocation result = new AlternateConstructorInvocation();
		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;
	}
	
}
