public static boolean matchAtBeansClassTemplateBuilder(Type targetType, boolean hasAnnotation) {
        Class<?> targetClass = (Class<?>) targetType;
        if (hasAnnotation) {
            return AbstractTemplateBuilder.isAnnotated((Class<?>) targetType, Beans.class)
                    || AbstractTemplateBuilder.isAnnotated((Class<?>) targetType, MessagePackBeans.class);
        } else {
            return !targetClass.isEnum() || !targetClass.isInterface();
        }
    }