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

package lombok.ast;

public class TypeReference extends lombok.ast.AbstractNode implements lombok.ast.DescribedNode {
	private WildcardKind wildcard = lombok.ast.WildcardKind.NONE;
	lombok.ast.ListAccessor<TypeReferencePart, lombok.ast.TypeReference> parts = ListAccessor.of(this, TypeReferencePart.class, "TypeReference.parts");
	private int arrayDimensions = 0;
	
	public TypeVariable upIfTypeVariableBoundToTypeVariable() {
		if (!(this.getParent() instanceof TypeVariable)) return null;
		TypeVariable out = (TypeVariable)this.getParent();
		if (!out.rawExtending().contains(this)) return null;
		return out;
	}
	
	public TypeReferencePart upIfTypeArgumentToTypeReferencePart() {
		if (!(this.getParent() instanceof TypeReferencePart)) return null;
		TypeReferencePart out = (TypeReferencePart)this.getParent();
		if (!out.rawTypeArguments().contains(this)) return null;
		return out;
	}
	
	public MethodDeclaration upIfReturnTypeToMethodDeclaration() {
		if (!(this.getParent() instanceof MethodDeclaration)) return null;
		MethodDeclaration out = (MethodDeclaration)this.getParent();
		if (out.rawReturnTypeReference() != this) return null;
		return out;
	}
	
	public ClassLiteral upToClassLiteral() {
		if (!(this.getParent() instanceof ClassLiteral)) return null;
		ClassLiteral out = (ClassLiteral)this.getParent();
		if (out.rawTypeReference() != this) return null;
		return out;
	}
	
	
	public WildcardKind astWildcard() {
		return this.wildcard;
	}
	
	public lombok.ast.TypeReference astWildcard(WildcardKind wildcard) {
		this.wildcard = wildcard== null ? lombok.ast.WildcardKind.NONE : wildcard;
		return this;
	}
	
	public lombok.ast.RawListAccessor<TypeReferencePart, lombok.ast.TypeReference> rawParts() {
		return this.parts.asRaw();
	}
	
	public lombok.ast.StrictListAccessor<TypeReferencePart, lombok.ast.TypeReference> astParts() {
		return this.parts.asStrict();
	}
	
	public int astArrayDimensions() {
		return this.arrayDimensions;
	}
	
	public lombok.ast.TypeReference astArrayDimensions(int arrayDimensions) {
		this.arrayDimensions = arrayDimensions;
		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.visitTypeReference(this)) return;
		for (lombok.ast.Node child : this.parts.asIterable()) {
			child.accept(visitor);
		}
		visitor.afterVisitTypeReference(this);
		visitor.endVisit(this);
	}
	
	@java.lang.Override public TypeReference copy() {
		TypeReference result = new TypeReference();
		result.wildcard = this.wildcard;
		for (Node n : this.parts.backingList()) {
			result.rawParts().addToEnd(n == null ? null : n.copy());
		}
		result.arrayDimensions = this.arrayDimensions;
		return result;
	}
	
	public java.lang.String getDescription() {
		return lombok.ast.TypeReferenceTemplate.getDescription(this);
	}
	
	public static TypeReference VOID() {
		return lombok.ast.TypeReferenceTemplate.VOID();
	}
	
	public static TypeReference BOOLEAN() {
		return lombok.ast.TypeReferenceTemplate.BOOLEAN();
	}
	
	public static TypeReference INT() {
		return lombok.ast.TypeReferenceTemplate.INT();
	}
	
	public static TypeReference LONG() {
		return lombok.ast.TypeReferenceTemplate.LONG();
	}
	
	public static TypeReference SHORT() {
		return lombok.ast.TypeReferenceTemplate.SHORT();
	}
	
	public static TypeReference BYTE() {
		return lombok.ast.TypeReferenceTemplate.BYTE();
	}
	
	public static TypeReference CHAR() {
		return lombok.ast.TypeReferenceTemplate.CHAR();
	}
	
	public static TypeReference DOUBLE() {
		return lombok.ast.TypeReferenceTemplate.DOUBLE();
	}
	
	public static TypeReference FLOAT() {
		return lombok.ast.TypeReferenceTemplate.FLOAT();
	}
	
	public static TypeReference fromName(java.lang.String name) {
		return lombok.ast.TypeReferenceTemplate.fromName(name);
	}
	
	public boolean isPrimitive() {
		return lombok.ast.TypeReferenceTemplate.isPrimitive(this);
	}
	
	public boolean isBoolean() {
		return lombok.ast.TypeReferenceTemplate.isBoolean(this);
	}
	
	public boolean isInt() {
		return lombok.ast.TypeReferenceTemplate.isInt(this);
	}
	
	public boolean isLong() {
		return lombok.ast.TypeReferenceTemplate.isLong(this);
	}
	
	public boolean isShort() {
		return lombok.ast.TypeReferenceTemplate.isShort(this);
	}
	
	public boolean isByte() {
		return lombok.ast.TypeReferenceTemplate.isByte(this);
	}
	
	public boolean isChar() {
		return lombok.ast.TypeReferenceTemplate.isChar(this);
	}
	
	public boolean isDouble() {
		return lombok.ast.TypeReferenceTemplate.isDouble(this);
	}
	
	public boolean isFloat() {
		return lombok.ast.TypeReferenceTemplate.isFloat(this);
	}
	
	public boolean isVoid() {
		return lombok.ast.TypeReferenceTemplate.isVoid(this);
	}
	
	public java.lang.String getTypeName() {
		return lombok.ast.TypeReferenceTemplate.getTypeName(this);
	}
	
	public boolean hasTypeArguments() {
		return lombok.ast.TypeReferenceTemplate.hasTypeArguments(this);
	}
	
	public lombok.ast.StrictListAccessor<TypeReference,TypeReference> getTypeArguments() {
		return lombok.ast.TypeReferenceTemplate.getTypeArguments(this);
	}
	
}
