Class PrimitiveElement

  • All Implemented Interfaces:
    io.micronaut.core.annotation.AnnotatedElement, io.micronaut.core.annotation.AnnotationMetadata, io.micronaut.core.annotation.AnnotationMetadataDelegate, io.micronaut.core.annotation.AnnotationMetadataProvider, io.micronaut.core.annotation.AnnotationSource, io.micronaut.core.naming.Described, io.micronaut.core.naming.Named, ArrayableClassElement, ClassElement, Element, TypedElement

    public final class PrimitiveElement
    extends java.lang.Object
    implements ArrayableClassElement
    A ClassElement of primitive types.
    • Method Detail

      • isAssignable

        public boolean isAssignable​(java.lang.String type)
        Description copied from interface: ClassElement
        Tests whether one type is assignable to another.
        Specified by:
        isAssignable in interface ClassElement
        Parameters:
        type - The type to check
        Returns:
        true if and only if this type is assignable to the second
      • isAssignable

        public boolean isAssignable​(ClassElement type)
        Description copied from interface: ClassElement
        Tests whether one type is assignable to another.
        Specified by:
        isAssignable in interface ClassElement
        Parameters:
        type - The type to check
        Returns:
        true if and only if this type is assignable to the second
      • isArray

        public boolean isArray()
        Description copied from interface: TypedElement
        Is the type an array.
        Specified by:
        isArray in interface TypedElement
        Returns:
        True if it is.
      • getArrayDimensions

        public int getArrayDimensions()
        Description copied from interface: TypedElement
        If the type is an array, the number of dimensions. String[] should return 1, String[][] should return 2
        Specified by:
        getArrayDimensions in interface TypedElement
        Returns:
        The number of dimensions
      • getName

        @NonNull
        public java.lang.String getName()
        Specified by:
        getName in interface Element
        Specified by:
        getName in interface io.micronaut.core.naming.Named
        Returns:
        The name of the element. For a type this represents the binary name.
      • isProtected

        public boolean isProtected()
        Specified by:
        isProtected in interface Element
        Returns:
        True if the element is protected.
      • isPublic

        public boolean isPublic()
        Specified by:
        isPublic in interface Element
        Returns:
        True if the element is public.
      • getNativeType

        @NonNull
        public java.lang.Object getNativeType()
        Description copied from interface: Element
        Returns the native underlying type. This API is extended by all of the inject language implementations. The object returned by this method will be the language native type the information is being retrieved from.
        Specified by:
        getNativeType in interface Element
        Returns:
        The native type
      • getAnnotationMetadata

        public io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()
        Specified by:
        getAnnotationMetadata in interface io.micronaut.core.annotation.AnnotationMetadataProvider
      • withArrayDimensions

        public ClassElement withArrayDimensions​(int arrayDimensions)
        Description copied from interface: ArrayableClassElement
        Convert the class element to an element for the same type, but with the given number of array dimensions. Do not mutate the existing instance. Create a new instance instead.
        Specified by:
        withArrayDimensions in interface ArrayableClassElement
        Parameters:
        arrayDimensions - The number of array dimensions of the new class element
        Returns:
        A new class element
      • isPrimitive

        public boolean isPrimitive()
        Description copied from interface: TypedElement
        Whether the type is primitive.
        Specified by:
        isPrimitive in interface TypedElement
        Returns:
        True if it is