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

package lombok.ast;

public class ImportDeclaration extends lombok.ast.AbstractNode {
	private boolean staticImport = false;
	lombok.ast.ListAccessor<Identifier, lombok.ast.ImportDeclaration> parts = ListAccessor.of(this, Identifier.class, "ImportDeclaration.parts");
	private boolean starImport = false;
	
	public CompilationUnit upToCompilationUnit() {
		if (!(this.getParent() instanceof CompilationUnit)) return null;
		CompilationUnit out = (CompilationUnit)this.getParent();
		if (!out.rawImportDeclarations().contains(this)) return null;
		return out;
	}
	
	
	public boolean astStaticImport() {
		return this.staticImport;
	}
	
	public lombok.ast.ImportDeclaration astStaticImport(boolean staticImport) {
		this.staticImport = staticImport;
		return this;
	}
	
	public lombok.ast.RawListAccessor<Identifier, lombok.ast.ImportDeclaration> rawParts() {
		return this.parts.asRaw();
	}
	
	public lombok.ast.StrictListAccessor<Identifier, lombok.ast.ImportDeclaration> astParts() {
		return this.parts.asStrict();
	}
	
	public boolean astStarImport() {
		return this.starImport;
	}
	
	public lombok.ast.ImportDeclaration astStarImport(boolean starImport) {
		this.starImport = starImport;
		return this;
	}
	
	@java.lang.Override public java.util.List<Node> getChildren() {
		java.util.List<Node> result = new java.util.ArrayList<Node>();
		result.addAll(this.parts.backingList());
		return result;
	}
	
	@java.lang.Override public boolean replaceChild(Node original, Node replacement) throws lombok.ast.AstException {
		if (this.rawParts().replace(original, replacement)) return true;
		return false;
	}
	
	@java.lang.Override public boolean detach(Node child) {
		if (this.rawParts().remove(child)) return true;
		return false;
	}
	
	@java.lang.Override public void accept(lombok.ast.AstVisitor visitor) {
		if (visitor.visitImportDeclaration(this)) return;
		for (lombok.ast.Node child : this.parts.asIterable()) {
			child.accept(visitor);
		}
		visitor.afterVisitImportDeclaration(this);
		visitor.endVisit(this);
	}
	
	@java.lang.Override public ImportDeclaration copy() {
		ImportDeclaration result = new ImportDeclaration();
		result.staticImport = this.staticImport;
		for (Node n : this.parts.backingList()) {
			result.rawParts().addToEnd(n == null ? null : n.copy());
		}
		result.starImport = this.starImport;
		return result;
	}
	
	public java.lang.String asFullyQualifiedName() {
		return lombok.ast.ImportDeclarationTemplate.asFullyQualifiedName(this);
	}
	
}
