Interface ArrayableClassElement

  • All Superinterfaces:
    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, ClassElement, io.micronaut.core.naming.Described, Element, io.micronaut.core.naming.Named, TypedElement
    All Known Implementing Classes:
    PrimitiveElement

    @Internal
    public interface ArrayableClassElement
    extends ClassElement
    Interface for class elements that can be converted to/from an array type.
    • Method Detail

      • toArray

        default ClassElement toArray()
        Description copied from interface: ClassElement
        Convert the class element to an element for the same type, but representing an array. Do not mutate the existing instance. Create a new instance instead.
        Specified by:
        toArray in interface ClassElement
        Returns:
        A new class element
      • fromArray

        default ClassElement fromArray()
        Description copied from interface: ClassElement
        Dereference a class element denoting an array type by converting it to its element type. Do not mutate the existing instance. Create a new instance instead.
        Specified by:
        fromArray in interface ClassElement
        Returns:
        A new class element
      • withArrayDimensions

        ClassElement withArrayDimensions​(int arrayDimensions)
        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.
        Parameters:
        arrayDimensions - The number of array dimensions of the new class element
        Returns:
        A new class element