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
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 Summary
FieldsFields inherited from interface org.axonframework.messaging.responsetypes.ResponseType
MATCH, NO_MATCH -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractResponseType(Class<?> expectedResponseType) Instantiate aResponseTypewith the givenexpectedResponseTypeas 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. -
Method Summary
Modifier and TypeMethodDescriptionbooleanClass<?> Gets actual response type or generic placeholder.inthashCode()protected booleanprotected booleanisArrayOfExpectedType(Type responseType) protected booleanisAssignableFrom(Type responseType) protected booleanisGenericArrayOfExpectedType(Type responseType) protected booleanisGenericArrayType(Type responseType) protected booleanisGenericAssignableFrom(Type responseType) protected booleanisIterableOfExpectedType(Type responseType) protected booleanisParameterizedType(Type responseType) protected booleanisParameterizedTypeOfExpectedType(Type responseType) protected booleanisPublisherOfExpectedType(Type responseType) protected booleanisStreamOfExpectedType(Type responseType) protected booleanisTypeVariable(Type responseType) protected booleanisWildcardType(Type responseType) protected booleanisWildcardTypeWithMatchingUpperBound(Type responseType) protected booleanprotected TypeunwrapIfTypeFuture(Type type) Deprecated.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.messaging.responsetypes.ResponseType
convert, convertExceptional, forSerialization, matches, matchRank, responseMessagePayloadType
-
Field Details
-
expectedResponseType
-
-
Constructor Details
-
AbstractResponseType
Instantiate aResponseTypewith the givenexpectedResponseTypeas 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
Description copied from interface:ResponseTypeGets actual response type or generic placeholder.- Specified by:
getExpectedResponseTypein interfaceResponseType<R>- Returns:
- actual response type or generic placeholder
-
unwrapIfTypeFuture
Deprecated.UseReflectionUtils.unwrapIfType(Type, Class[])insteadTries to unwrap generic type if providedtypeis of typeFuture.- Parameters:
type- to be unwrapped- Returns:
- unwrapped generic, or original if provided
typeis not of typeFuture
-
isPublisherOfExpectedType
-
isIterableOfExpectedType
-
isStreamOfExpectedType
-
isParameterizedTypeOfExpectedType
-
isParameterizedType
-
isWildcardTypeWithMatchingUpperBound
-
isWildcardType
-
isArrayOfExpectedType
-
isArray
-
isGenericArrayOfExpectedType
-
isGenericArrayType
-
isGenericAssignableFrom
-
isTypeVariable
-
isAssignableFrom
-
projectReactorOnClassPath
protected boolean projectReactorOnClassPath() -
equals
-
hashCode
public int hashCode()
-
ReflectionUtils.unwrapIfType(Type, Class[])instead