public static <T extends BaseEnum<?>> boolean isValidEnum(final Class<T> clazz, final String code,
        final boolean ignoreNull) {
        if (code == null) {
            return ignoreNull;
        }
        return getEnumMap(clazz).containsKey(code);
    }
Verify whether it is a valid enumeration

@param clazz enumeration class
@param code The encoding of the enumeration. If it is empty, it is considered an invalid enumeration.
@param ignoreNull whether to ignore empty codes
@param <T> The type of enumeration
@return Is it valid?
chat2db-server/chat2db-server-tools/chat2db-server-tools-common/src/main/java/ai/chat2db/server/tools/common/util/EasyEnumUtils.java