Class AbstractResponseType<R>

java.lang.Object
org.axonframework.messaging.responsetypes.AbstractResponseType<R>
Type Parameters:
R - The response type which will be matched against and converted to
All Implemented Interfaces:
Serializable, ResponseType<R>
Direct Known Subclasses:
InstanceResponseType, MultipleInstancesResponseType, OptionalResponseType, PublisherResponseType

public abstract class AbstractResponseType<R> extends Object implements ResponseType<R>
Abstract implementation of the ResponseType which contains match functions for the majority of the Type options available. For single instance response types, a direct assignable to check will be performed. For multiple instances response types, the match will be performed against the containing type of that array/collection/etc. Proves useful for reuse among ResponseType implementations.
Since:
3.2
Author:
Steven van Beelen
See Also:
  • Field Details

    • expectedResponseType

      protected final Class<?> expectedResponseType
  • Constructor Details

    • AbstractResponseType

      protected AbstractResponseType(Class<?> expectedResponseType)
      Instantiate a ResponseType with the given expectedResponseType as the type to be matched against and to which the query response should be converted to, as is or as the contained type for an array/list/etc.
      Parameters:
      expectedResponseType - the response type which is expected to be matched against and to be returned, as is or as the contained type for an array/list/etc
  • Method Details

    • getExpectedResponseType

      public Class<?> getExpectedResponseType()
      Description copied from interface: ResponseType
      Gets actual response type or generic placeholder.
      Specified by:
      getExpectedResponseType in interface ResponseType<R>
      Returns:
      actual response type or generic placeholder
    • unwrapIfTypeFuture

      @Deprecated protected Type unwrapIfTypeFuture(Type type)
      Tries to unwrap generic type if provided type is of type Future.
      Parameters:
      type - to be unwrapped
      Returns:
      unwrapped generic, or original if provided type is not of type Future
    • isPublisherOfExpectedType

      protected boolean isPublisherOfExpectedType(Type responseType)
    • isIterableOfExpectedType

      protected boolean isIterableOfExpectedType(Type responseType)
    • isStreamOfExpectedType

      protected boolean isStreamOfExpectedType(Type responseType)
    • isParameterizedTypeOfExpectedType

      protected boolean isParameterizedTypeOfExpectedType(Type responseType)
    • isParameterizedType

      protected boolean isParameterizedType(Type responseType)
    • isWildcardTypeWithMatchingUpperBound

      protected boolean isWildcardTypeWithMatchingUpperBound(Type responseType)
    • isWildcardType

      protected boolean isWildcardType(Type responseType)
    • isArrayOfExpectedType

      protected boolean isArrayOfExpectedType(Type responseType)
    • isArray

      protected boolean isArray(Type responseType)
    • isGenericArrayOfExpectedType

      protected boolean isGenericArrayOfExpectedType(Type responseType)
    • isGenericArrayType

      protected boolean isGenericArrayType(Type responseType)
    • isGenericAssignableFrom

      protected boolean isGenericAssignableFrom(Type responseType)
    • isTypeVariable

      protected boolean isTypeVariable(Type responseType)
    • isAssignableFrom

      protected boolean isAssignableFrom(Type responseType)
    • projectReactorOnClassPath

      protected boolean projectReactorOnClassPath()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object