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

package lombok.ast;

public class NormalTypeBody extends lombok.ast.AbstractNode implements lombok.ast.TypeBody {
	lombok.ast.ListAccessor<TypeMember, lombok.ast.NormalTypeBody> members = ListAccessor.of(this, TypeMember.class, "NormalTypeBody");
	
	public ConstructorInvocation upIfAnonymousClassToConstructorInvocation() {
		if (!(this.getParent() instanceof ConstructorInvocation)) return null;
		ConstructorInvocation out = (ConstructorInvocation)this.getParent();
		if (out.rawAnonymousClassBody() != this) return null;
		return out;
	}
	
	public EnumConstant upToEnumConstant() {
		if (!(this.getParent() instanceof EnumConstant)) return null;
		EnumConstant out = (EnumConstant)this.getParent();
		if (out.rawBody() != this) return null;
		return out;
	}
	
	public TypeDeclaration upToTypeDeclaration() {
		if (!(this.getParent() instanceof TypeDeclaration)) return null;
		TypeDeclaration out = (TypeDeclaration)this.getParent();
		if (out.rawBody() != this) return null;
		return out;
	}
	
	
	public lombok.ast.RawListAccessor<TypeMember, lombok.ast.NormalTypeBody> rawMembers() {
		return this.members.asRaw();
	}
	
	public lombok.ast.StrictListAccessor<TypeMember, lombok.ast.NormalTypeBody> astMembers() {
		return this.members.asStrict();
	}
	
	@java.lang.Override public java.util.List<Node> getChildren() {
		java.util.List<Node> result = new java.util.ArrayList<Node>();
		result.addAll(this.members.backingList());
		return result;
	}
	
	@java.lang.Override public boolean replaceChild(Node original, Node replacement) throws lombok.ast.AstException {
		if (this.rawMembers().replace(original, replacement)) return true;
		return false;
	}
	
	@java.lang.Override public boolean detach(Node child) {
		if (this.rawMembers().remove(child)) return true;
		return false;
	}
	
	@java.lang.Override public void accept(lombok.ast.AstVisitor visitor) {
		if (visitor.visitNormalTypeBody(this)) return;
		for (lombok.ast.Node child : this.members.asIterable()) {
			child.accept(visitor);
		}
		visitor.afterVisitNormalTypeBody(this);
		visitor.endVisit(this);
	}
	
	@java.lang.Override public NormalTypeBody copy() {
		NormalTypeBody result = new NormalTypeBody();
		for (Node n : this.members.backingList()) {
			result.rawMembers().addToEnd(n == null ? null : n.copy());
		}
		return result;
	}
	
}
