Interface CallAdapterFactory


public interface CallAdapterFactory
Recognizes a method's declared return type and produces a CallAdapter for it, or declines. Registered via RIP.addCallAdapterFactory(CallAdapterFactory); every registered factory is consulted, in registration order, and the first non-empty Optional wins - mirroring RequestInterceptor's own "registration order matters" convention. See docs/design/reactor-call-adapter.md ยง5.
  • Method Summary

    Modifier and Type
    Method
    Description
    get(Method method)
     
  • Method Details

    • get

      Optional<CallAdapter<?>> get(Method method)
      Parameters:
      method - the interface method being dispatched or, at RIP.getClient(...) time, validated - ReflectiveRestClientValidator calls this exact method to check a claimed adapter's declared return type before the client is ever built, so a factory must behave identically both times for the same method
      Returns:
      an adapter for method's return type, or Optional.empty() to decline. RIP's own built-in shapes (CompletableFuture, RipResponse, byte[], File) are handled first and always win - a factory is only ever consulted for a return type none of those already claim, so declaring one of them here has no effect. Declining also lets RIP try the next registered factory, in registration order.