+ /**
+ * Register a set of {@link Rpc} implementations.
+ *
+ * @param implementations implementation objects
+ * @return A {@link Registration} controlling unregistration
+ * @throws NullPointerException if {@code implementations} is, or contains, {@code null}
+ * @throws IllegalArgumentException if there are implementations contains {@link Rpc#implementedInterface()}
+ * duplicates
+ */
+ default @NonNull Registration registerRpcImplementations(final Rpc<?, ?>... implementations) {
+ return registerRpcImplementations(List.of(implementations));
+ }
+
+ /**
+ * Register a set of {@link Rpc} implementations.
+ *
+ * @param implementations implementation objects
+ * @return A {@link Registration} controlling unregistration
+ * @throws NullPointerException if {@code implementations} is, or contains, {@code null}
+ * @throws IllegalArgumentException if there are implementations contains {@link Rpc#implementedInterface()}
+ * duplicates
+ */
+ default @NonNull Registration registerRpcImplementations(final Collection<Rpc<?, ?>> implementations) {
+ return registerRpcImplementations(indexImplementations(implementations));
+ }
+
+ /**
+ * Register a set of {@link Rpc} implementations on a set of datastore context paths. Note that this method does not
+ * support registering multiple implementations of the same {@link Rpc} and hence we require specifying them through
+ * a {@link ClassToInstanceMap}.
+ *
+ * @param implementations implementation objects
+ * @return A {@link Registration} controlling unregistration
+ * @throws NullPointerException if any argument is, or contains, {@code null}
+ * @throws IllegalArgumentException if there are implementations contains {@link Rpc#implementedInterface()}
+ * duplicates
+ */
+ default @NonNull Registration registerRpcImplementations(final Collection<Rpc<?, ?>> implementations,
+ final Set<InstanceIdentifier<?>> paths) {
+ return registerRpcImplementations(indexImplementations(implementations), paths);
+ }
+