code: public static boolean matchesTypeName(Class<?> clazz, String typeName) {
          return (typeName != null &&
                  (typeName.equals(clazz.getTypeName()) || typeName.equals(clazz.getSimpleName())));
      }
docs: Check whether the given class matches the user-specified type name.
  
  @param clazz    the class to check
  @param typeName the type name to match