Uploaded image for project: 'mdsal'
  1. mdsal
  2. MDSAL-854

Improve RpcProviderService.registerRpcImplementations()

XMLWordPrintable

      We requires a ClassToInstanceMap here, mirror the API from mdsal-dom-api.

      While this is required in mdsal-dom-api, as we cannot determine the RPC type, with binding we can do better:

          default @NonNull Registration registerRpcImplementations(final Collection<Rpc<?, ?>> implementations) {
              final var map = MutableClassToInstanceMap.<Rpc<?, ?>> create();
              for (var impl : implementations) {
                  map.put(impl.implementedInterface(), impl);
              }
              return registerRpcImplementations(map);
          }
      

      i.e. determine the implemented interface and index passed in implementations. This allows downstreams to use varargs.

            rovarga Robert Varga
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: