static RegisteredConversion compute(final Class<?> src, final Class<?> dst) {
      final Deque<Class<?>> sourceTypes = new ArrayDeque<>();
      sourceTypes.add(src);
      // walk up the source type hierarchy to find an option
      for (Class<?> sourcePtr; (sourcePtr = sourceTypes.poll()) != null;) {
        final Set<RegisteredConversion> conversions = CONVERSIONS.get(sourcePtr);
        if (conversions != null) {
          // if we have values for the source type, evaluate each to find the one that matches either the exact destination type, or the nearest subtype
          RegisteredConversion nearest = null;
          for (final RegisteredConversion potential : conversions) {
            final Class<?> potentialDst = potential.conversion.destination();

            if (dst.equals(potentialDst)) return potential; // exact match
            if (!dst.isAssignableFrom(potentialDst)) continue; // out of hierarchy

            // if we are up the hierarchy
            if (nearest == null || potentialDst.isAssignableFrom(nearest.conversion.destination())) {
              nearest = potential;
            }
          }

          if (nearest != null) return nearest; // we found a match
        }

        addSupertypes(sourcePtr, sourceTypes);
      }

      return RegisteredConversion.NONE;
    }
Perform the actual conversion.

@param key the key used for the data holder
@param input the source type
@return a data holder of the destination type
@since 4.17.0
api/src/main/java/net/kyori/adventure/text/event/DataComponentValueConverterRegistry.java