Interface UType
Utility type to help process
TypeMirrors-
Method Summary
Modifier and TypeMethodDescriptiondefault List<AnnotationMirror> Return the annotation mirrors directly on the type and in within generic type use.default List<AnnotationMirror> Return the annotation mirrors directly on the type.Retrieve the component types associated with this mirror.booleanCompare whether the current full() type is identical to the given UType's full() typefull()Return the full type as a code safe string.default StringReturn 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 booleanReturns whether the type mirror is generickind()TheTypeKindof the type mirror used to create this Utype.mainType()Return the main type (outermost type). e.g for mirror invalid input: '{@' java.util.Listyou'll get java.util.List default UTypeparam0()Return the first generic parameter.default UTypeparam1()Return the second componentType.static UTypeparse(TypeMirror mirror) Create a UType from the given TypeMirror.Return the full (but unqualified) type as a code safe string.default StringReturn the short type as a string, stripped of annotations.
-
Method Details
-
parse
Create a UType from the given TypeMirror.- Parameters:
mirror- type mirror to analyze- Returns:
- Create the UType from the given TypeMirror.
-
importTypes
-
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.Listyou'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 withimportTypes()to generate readable code- Returns:
- the short name with unqualified type
-
param0
-
param1
-
componentTypes
Retrieve the component types associated with this mirror.TypeKind.ARRAY: will contain the array componentTypeTypeKind.DECLARED: will contain the generic parametersTypeKind.TYPEVAR: will contain the upper bound for the type variableTypeKind.WILDCARD: will contain the extends bound or super boundTypeKind.INTERSECTION: will contain the bounds of the intersectionTypeKind.UNION: will contain the alternative types
- Returns:
- the component types
-
kind
-
isGeneric
default boolean isGeneric()Returns whether the type mirror is generic- Returns:
- whether the type is generic
-
annotations
Return the annotation mirrors directly on the type.For a
UTyperepresenting@NotEmpty Map<@Notblank String, Object>you will get mirrors for@NotEmptyonly- Returns:
- the annotations directly present
-
allAnnotationsInType
Return the annotation mirrors directly on the type and in within generic type use.For a
UTyperepresenting@NotEmpty Map<@Notblank String, Object>you will get mirrors for@NotEmptyand@Notblank- Returns:
- all annotations present on this type
-
fullWithoutAnnotations
Return the full type as a string, stripped of annotations.- Returns:
- full type, but without annotations
-
shortWithoutAnnotations
Return the short type as a string, stripped of annotations.- Returns:
- short type, but without annotations
-
equals
-