archunit - navigate from JavaType to corresponding JavaClasss

57 Views Asked by At

How am I supposed to navigate from a JavaType instance in archunit to the corresponding JavaClass? I need to check if a method return type is primitive but JavaMethod.getJavaType() returns a JavaType that offers no means to check if the return type is primitive.

1

There are 1 best solutions below

1
Manfred On BEST ANSWER

If you're not interested in generic type information, you can use javaType.toErasure() to navigate to the corresponding JavaClass.