@Generated("avaje-prism-generator") public interface UType
Utility type to help process TypeMirrors
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the annotation mirrors directly on the type and in within generic type use.
    Return the annotation mirrors directly on the type.
    default List<UType>
    Retrieve the component types associated with this mirror.
    boolean
    equals(Object other)
    Compare whether the current full() type is identical to the given UType's full() type
    Return the full type as a code safe string.
    default String
    Return the full type as a string, stripped of annotations.
    Return all the import types needed to write this mirror in source code (annotations included).
    default boolean
    Returns whether the type mirror is generic
    The TypeKind of the type mirror used to create this Utype.
    Return the main type (outermost type). e.g for mirror invalid input: '{@' java.util.List you'll get java.util.List
    default UType
    Return the first generic parameter.
    default UType
    Return the second componentType.
    static UType
    parse(TypeMirror mirror)
    Create a UType from the given TypeMirror.
    Return the full (but unqualified) type as a code safe string.
    default String
    Return the short type as a string, stripped of annotations.
  • Method Details

    • parse

      static UType parse(TypeMirror mirror)
      Create a UType from the given TypeMirror.
      Parameters:
      mirror - type mirror to analyze
      Returns:
      Create the UType from the given TypeMirror.
    • importTypes

      Set<String> importTypes()
      Return all the import types needed to write this mirror in source code (annotations included).
      Returns:
      Return the import types required.
    • full

      String full()
      Return the full type as a code safe string. (with annotations if present)
      Returns:
      the full typeName
    • mainType

      String mainType()
      Return the main type (outermost type). e.g for mirror invalid input: '{@' java.util.List you'll get java.util.List
      Returns:
      the outermost type
    • shortType

      String shortType()
      Return the full (but unqualified) type as a code safe string. Use in tandem with importTypes() to generate readable code
      Returns:
      the short name with unqualified type
    • param0

      default UType param0()
      Return the first generic parameter.
      See Also:
    • param1

      default UType param1()
      Return the second componentType.
      See Also:
    • componentTypes

      default List<UType> componentTypes()
      Retrieve the component types associated with this mirror.
      Returns:
      the component types
    • kind

      TypeKind kind()
      The TypeKind of the type mirror used to create this Utype.
    • isGeneric

      default boolean isGeneric()
      Returns whether the type mirror is generic
      Returns:
      whether the type is generic
    • annotations

      default List<AnnotationMirror> annotations()
      Return the annotation mirrors directly on the type.

      For a UType representing @NotEmpty Map<@Notblank String, Object> you will get mirrors for @NotEmpty only

      Returns:
      the annotations directly present
    • allAnnotationsInType

      default List<AnnotationMirror> allAnnotationsInType()
      Return the annotation mirrors directly on the type and in within generic type use.

      For a UType representing @NotEmpty Map<@Notblank String, Object> you will get mirrors for @NotEmpty and @Notblank

      Returns:
      all annotations present on this type
    • fullWithoutAnnotations

      default String fullWithoutAnnotations()
      Return the full type as a string, stripped of annotations.
      Returns:
      full type, but without annotations
    • shortWithoutAnnotations

      default String shortWithoutAnnotations()
      Return the short type as a string, stripped of annotations.
      Returns:
      short type, but without annotations
    • equals

      boolean equals(Object other)
      Compare whether the current full() type is identical to the given UType's full() type
      Overrides:
      equals in class Object