Interface ArrayableClassElement

All Superinterfaces:
AnnotatedElement, AnnotationMetadata, AnnotationMetadataDelegate, AnnotationMetadataProvider, AnnotationSource, ClassElement, Described, Element, MutableAnnotationMetadataDelegate<Element>, Named, TypedElement
All Known Implementing Classes:
GroovyClassElement, JavaClassElement, PrimitiveElement

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

    • 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