private static <T> Optional<EnumStrategy> doFindStrategy(QualifiedType<T> type) {
        boolean hasByName = type.hasQualifier(EnumByName.class);
        boolean hasByOrdinal = type.hasQualifier(EnumByOrdinal.class);

        if (hasByName && hasByOrdinal) {
            throw new IllegalArgumentException(String.format(
                "%s is both %s and %s",
                type.getType(),
                EnumByName.class.getSimpleName(),
                EnumByOrdinal.class.getSimpleName()
            ));
        }

        if (hasByName) {
            return Optional.of(EnumStrategy.BY_NAME);
        } else if (hasByOrdinal) {
            return Optional.of(EnumStrategy.BY_ORDINAL);
        } else {
            return Optional.empty();
        }
    }
Determines which strategy is to be used for a given {@link QualifiedType}, falling back to
reading strategy annotations on the source class and/or using the configured default.

@param <E> the {@link Enum} type
@param type qualified type to derive a strategy from
@return the strategy by which this enum should be handled
core/src/main/java/org/jdbi/v3/core/internal/EnumStrategies.java