Class TypeUtils


  • public class TypeUtils
    extends java.lang.Object
    • Method Detail

      • isString

        public static boolean isString​(@Nullable
                                       @Nullable JavaType type)
      • fullyQualifiedNamesAreEqual

        public static boolean fullyQualifiedNamesAreEqual​(@Nullable
                                                          @Nullable java.lang.String fqn1,
                                                          @Nullable
                                                          @Nullable java.lang.String fqn2)
      • isOfType

        public static boolean isOfType​(@Nullable
                                       @Nullable JavaType type1,
                                       @Nullable
                                       @Nullable JavaType type2)
      • isOfClassType

        public static boolean isOfClassType​(@Nullable
                                            @Nullable JavaType type,
                                            java.lang.String fqn)
      • isAssignableTo

        public static boolean isAssignableTo​(@Nullable
                                             @Nullable JavaType to,
                                             @Nullable
                                             @Nullable JavaType from)
      • isAssignableTo

        public static boolean isAssignableTo​(java.lang.String to,
                                             @Nullable
                                             @Nullable JavaType from)
      • isOverride

        public static boolean isOverride​(@Nullable
                                         JavaType.Method method)
        Determine if a method overrides a method from a superclass or interface.
        Returns:
        `true` if a superclass or implemented interface declares a non-private method with matching signature. `false` if a match is not found or the method, declaring type, or generic signature is null.
      • findOverriddenMethod

        public static java.util.Optional<JavaType.Method> findOverriddenMethod​(@Nullable
                                                                               JavaType.Method method)
        Given a method type, searches the declaring type's parent and interfaces for a method with the same name and signature.

        NOTE: This method will return an empty optional if the method, the method's declaring type, or the method's generic signature is null.

        Returns:
        An optional overridden method type declared in the parent.