static QualifiedArgumentFactory.Preparable adapt(ConfigRegistry config, ArgumentFactory.Preparable factory) {
            return new Preparable() {
                final Set<Annotation> qualifiers =
                        config.get(Qualifiers.class)
                        .findFor(factory.getClass());

                final Collection<QualifiedType<?>> prePreparedTypes = Collections.unmodifiableList(
                        factory.prePreparedTypes().stream()
                            .map(QualifiedType::of)
                            .map(qt -> qt.withAnnotations(qualifiers))
                            .collect(Collectors.toList()));

                @Override
                public Optional<Argument> build(QualifiedType<?> type, Object value, ConfigRegistry cfg) {
                    return type.getQualifiers().equals(qualifiers)
                            ? factory.build(type.getType(), value, cfg)
                            : Optional.empty();
                }

                @Override
                public Optional<Function<Object, Argument>> prepare(QualifiedType<?> type, ConfigRegistry cfg) {
                    return type.getQualifiers().equals(qualifiers)
                            ? factory.prepare(type.getType(), cfg)
                            : Optional.empty();
                }

                /**
                 * @deprecated no longer used
                 */
                @Deprecated(since = "3.39.0", forRemoval = true)
                @Override
                public Collection<QualifiedType<?>> prePreparedTypes() {
                    return prePreparedTypes;
                }

                @Override
                public String toString() {
                    return "Qualified[" + factory + "]";
                }
            };
        }
Adapts an {@link ArgumentFactory.Preparable} into a QualifiedArgumentFactory.Preparable
The returned factory only matches qualified types with zero qualifiers.

@param factory the factory to adapt
core/src/main/java/org/jdbi/v3/core/argument/QualifiedArgumentFactory.java