class PrimitiveType extends Type implements NodeWithAnnotations<PrimitiveType> {

    public static PrimitiveType booleanType() {
        return new PrimitiveType(Primitive.BOOLEAN);
    }

    public static PrimitiveType charType() {
        return new PrimitiveType(Primitive.CHAR);
    }

    public static PrimitiveType byteType() {
        return new PrimitiveType(Primitive.BYTE);
    }

    public static PrimitiveType shortType() {
        return new PrimitiveType(Primitive.SHORT);
    }

    public static PrimitiveType intType() {
        return new PrimitiveType(Primitive.INT);
    }

    public static PrimitiveType longType() {
        return new PrimitiveType(Primitive.LONG);
    }

    public static PrimitiveType floatType() {
        return new PrimitiveType(Primitive.FLOAT);
    }

    public static PrimitiveType doubleType() {
        return new PrimitiveType(Primitive.DOUBLE);
    }

    public enum Primitive {

        BOOLEAN("Boolean", "Z"),
        CHAR("Character", "C"),
        BYTE("Byte", "B"),
        SHORT("Short", "S"),
        INT("Integer", "I"),
        LONG("Long", "J"),
        FLOAT("Float", "F"),
        DOUBLE("Double", "D");

        final String nameOfBoxedType;

        final String descriptor;

        private String codeRepresentation;

        /*
        * Returns the Primitive constant corresponding to the specified type name (e.g. "boolean", "int",
        * "long").
        */
        public static Optional<Primitive> byTypeName(String name) {
            for (Primitive primitive : values()) {
                if (primitive.name().toLowerCase().equals(name)) {
                    return Optional.of(primitive);
                }
            }
            return Optional.empty();
        }

        /*
        * Returns the Primitive constant corresponding to the specified boxed type name (e.g. "Boolean", "Integer",
        * "Long").
        */
        public static Optional<Primitive> byBoxedTypeName(String simpleName) {
            return Optional.ofNullable(unboxMap.getOrDefault(simpleName, null));
        }

        public ClassOrInterfaceType toBoxedType() {
            return parseClassOrInterfaceType(nameOfBoxedType);
        }

        public String asString() {
            return codeRepresentation;
        }

        public String toDescriptor() {
            return descriptor;
        }

        Primitive(String nameOfBoxedType, String descriptor) {
            this.nameOfBoxedType = nameOfBoxedType;
            this.codeRepresentation = name().toLowerCase();
            this.descriptor = descriptor;
        }
    }

    static final HashMap<String, Primitive> unboxMap = new HashMap<>();

    static {
        for (Primitive unboxedType : Primitive.values()) {
            unboxMap.put(unboxedType.nameOfBoxedType, unboxedType);
        }
    }

    private Primitive type;

    public PrimitiveType() {
        this(null, Primitive.INT, new NodeList<>());
    }

    public PrimitiveType(final Primitive type) {
        this(null, type, new NodeList<>());
    }

    @AllFieldsConstructor
    public PrimitiveType(final Primitive type, NodeList<AnnotationExpr> annotations) {
        this(null, type, annotations);
    }

    /**
     * This constructor is used by the parser and is considered private.
     */
    @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator")
    public PrimitiveType(TokenRange tokenRange, Primitive type, NodeList<AnnotationExpr> annotations) {
        super(tokenRange, annotations);
        setType(type);
        customInitialization();
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.AcceptGenerator")
    public <R, A> R accept(final GenericVisitor<R, A> v, final A arg) {
        return v.visit(this, arg);
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.AcceptGenerator")
    public <A> void accept(final VoidVisitor<A> v, final A arg) {
        v.visit(this, arg);
    }

    @Generated("com.github.javaparser.generator.core.node.PropertyGenerator")
    public Primitive getType() {
        return type;
    }

    public ClassOrInterfaceType toBoxedType() {
        return type.toBoxedType();
    }

    @Override
    public String toDescriptor() {
        return type.toDescriptor();
    }

    @Generated("com.github.javaparser.generator.core.node.PropertyGenerator")
    public PrimitiveType setType(final Primitive type) {<FILL_FUNCTION_BODY>}

    @Override
    public String asString() {
        return type.asString();
    }

    @Override
    public PrimitiveType setAnnotations(NodeList<AnnotationExpr> annotations) {
        return (PrimitiveType) super.setAnnotations(annotations);
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.CloneGenerator")
    public PrimitiveType clone() {
        return (PrimitiveType) accept(new CloneVisitor(), null);
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator")
    public PrimitiveTypeMetaModel getMetaModel() {
        return JavaParserMetaModel.primitiveTypeMetaModel;
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
    public boolean isPrimitiveType() {
        return true;
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
    public PrimitiveType asPrimitiveType() {
        return this;
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
    public void ifPrimitiveType(Consumer<PrimitiveType> action) {
        action.accept(this);
    }

    @Override
    public ResolvedPrimitiveType resolve() {
        return getSymbolResolver().toResolvedType(this, ResolvedPrimitiveType.class);
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
    public Optional<PrimitiveType> toPrimitiveType() {
        return Optional.of(this);
    }

	@Override
	public ResolvedType convertToUsage(Context context) {
		return ResolvedPrimitiveType.byName(getType().name());
	}
}

        assertNotNull(type);
        if (type == this.type) {
            return this;
        }
        notifyPropertyChange(ObservableProperty.TYPE, this.type, type);
        this.type = type;
        return this;
    
<methods>public void <init>(NodeList<com.github.javaparser.ast.expr.AnnotationExpr>) ,public void <init>(com.github.javaparser.TokenRange, NodeList<com.github.javaparser.ast.expr.AnnotationExpr>) ,public com.github.javaparser.ast.type.ArrayType asArrayType() ,public com.github.javaparser.ast.type.ClassOrInterfaceType asClassOrInterfaceType() ,public com.github.javaparser.ast.type.IntersectionType asIntersectionType() ,public com.github.javaparser.ast.type.PrimitiveType asPrimitiveType() ,public com.github.javaparser.ast.type.ReferenceType asReferenceType() ,public abstract java.lang.String asString() ,public com.github.javaparser.ast.type.TypeParameter asTypeParameter() ,public com.github.javaparser.ast.type.UnionType asUnionType() ,public com.github.javaparser.ast.type.UnknownType asUnknownType() ,public com.github.javaparser.ast.type.VarType asVarType() ,public com.github.javaparser.ast.type.VoidType asVoidType() ,public com.github.javaparser.ast.type.WildcardType asWildcardType() ,public com.github.javaparser.ast.type.Type clone() ,public com.github.javaparser.ast.expr.AnnotationExpr getAnnotation(int) ,public NodeList<com.github.javaparser.ast.expr.AnnotationExpr> getAnnotations() ,public int getArrayLevel() ,public com.github.javaparser.ast.type.Type getElementType() ,public com.github.javaparser.metamodel.TypeMetaModel getMetaModel() ,public void ifArrayType(Consumer<com.github.javaparser.ast.type.ArrayType>) ,public void ifClassOrInterfaceType(Consumer<com.github.javaparser.ast.type.ClassOrInterfaceType>) ,public void ifIntersectionType(Consumer<com.github.javaparser.ast.type.IntersectionType>) ,public void ifPrimitiveType(Consumer<com.github.javaparser.ast.type.PrimitiveType>) ,public void ifReferenceType(Consumer<com.github.javaparser.ast.type.ReferenceType>) ,public void ifTypeParameter(Consumer<com.github.javaparser.ast.type.TypeParameter>) ,public void ifUnionType(Consumer<com.github.javaparser.ast.type.UnionType>) ,public void ifUnknownType(Consumer<com.github.javaparser.ast.type.UnknownType>) ,public void ifVarType(Consumer<com.github.javaparser.ast.type.VarType>) ,public void ifVoidType(Consumer<com.github.javaparser.ast.type.VoidType>) ,public void ifWildcardType(Consumer<com.github.javaparser.ast.type.WildcardType>) ,public boolean isArrayType() ,public boolean isClassOrInterfaceType() ,public boolean isIntersectionType() ,public boolean isPrimitiveType() ,public boolean isReferenceType() ,public boolean isTypeParameter() ,public boolean isUnionType() ,public boolean isUnknownType() ,public boolean isVarType() ,public boolean isVoidType() ,public boolean isWildcardType() ,public boolean remove(com.github.javaparser.ast.Node) ,public boolean replace(com.github.javaparser.ast.Node, com.github.javaparser.ast.Node) ,public abstract com.github.javaparser.resolution.types.ResolvedType resolve() ,public com.github.javaparser.ast.type.Type setAnnotations(NodeList<com.github.javaparser.ast.expr.AnnotationExpr>) ,public Optional<com.github.javaparser.ast.type.ArrayType> toArrayType() ,public Optional<com.github.javaparser.ast.type.ClassOrInterfaceType> toClassOrInterfaceType() ,public java.lang.String toDescriptor() ,public Optional<com.github.javaparser.ast.type.IntersectionType> toIntersectionType() ,public Optional<com.github.javaparser.ast.type.PrimitiveType> toPrimitiveType() ,public Optional<com.github.javaparser.ast.type.ReferenceType> toReferenceType() ,public Optional<com.github.javaparser.ast.type.TypeParameter> toTypeParameter() ,public Optional<com.github.javaparser.ast.type.UnionType> toUnionType() ,public Optional<com.github.javaparser.ast.type.UnknownType> toUnknownType() ,public Optional<com.github.javaparser.ast.type.VarType> toVarType() ,public Optional<com.github.javaparser.ast.type.VoidType> toVoidType() ,public Optional<com.github.javaparser.ast.type.WildcardType> toWildcardType() <variables>private NodeList<com.github.javaparser.ast.expr.AnnotationExpr> annotations