Interface StreamListenerResultAdapter<R,​B>

  • Type Parameters:
    R - stream listener result type
    B - binding target type
    All Known Implementing Classes:
    MessageChannelStreamListenerResultAdapter

    public interface StreamListenerResultAdapter<R,​B>
    A strategy for adapting the result of a StreamListener annotated method to a binding target annotated with Output. Used when the StreamListener annotated method is operating in declarative mode.
    Author:
    Marius Bogoevici
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Closeable adapt​(R streamListenerResult, B bindingTarget)
      Adapts the result to the binding target.
      boolean supports​(Class<?> resultType, Class<?> bindingTarget)
      Return true if the result type can be converted to the binding target.
    • Method Detail

      • supports

        boolean supports​(Class<?> resultType,
                         Class<?> bindingTarget)
        Return true if the result type can be converted to the binding target.
        Parameters:
        resultType - the result type.
        bindingTarget - the binding target.
        Returns:
        true if the conversion can take place.
      • adapt

        Closeable adapt​(R streamListenerResult,
                        B bindingTarget)
        Adapts the result to the binding target.
        Parameters:
        streamListenerResult - the result of invoking the method.
        bindingTarget - the binding target.
        Returns:
        an adapted result