R
- The response type which will be matched against and converted topublic class InstanceResponseType<R> extends AbstractResponseType<R>
ResponseType
implementation that will match with query
handlers which return a single instance of the expected response type. If matching succeeds, the
ResponseType.convert(Object)
function will be called, which will cast the query handler it's response to
R
.expectedResponseType
Constructor and Description |
---|
InstanceResponseType(Class<R> expectedResponseType)
Instantiate a
InstanceResponseType with the given
expectedResponseType as the type to be matched against and to which the query response should be
converted to. |
Modifier and Type | Method and Description |
---|---|
boolean |
matches(Type responseType)
Match the query handler its response
Type with this implementation its responseType
R . |
Class<R> |
responseMessagePayloadType()
Returns a
Class representing the type of the payload to be contained in the response message. |
String |
toString() |
getExpectedResponseType, isArray, isArrayOfExpectedType, isAssignableFrom, isGenericArrayOfExpectedType, isGenericArrayType, isGenericAssignableFrom, isIterableOfExpectedType, isParameterizedType, isParameterizedTypeOfExpectedType, isStreamOfExpectedType, isTypeVariable, isWildcardType, isWildcardTypeWithMatchingUpperBound, unwrapIfTypeFuture
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
convert
public InstanceResponseType(Class<R> expectedResponseType)
InstanceResponseType
with the given
expectedResponseType
as the type to be matched against and to which the query response should be
converted to.expectedResponseType
- the response type which is expected to be matched against and returnedpublic boolean matches(Type responseType)
Type
with this implementation its responseType
R
.
Will return true if the expected type is assignable to the response type, taking generic types into account.responseType
- the response Type
of the query handler which is matched againstpublic Class<R> responseMessagePayloadType()
ResponseType
Class
representing the type of the payload to be contained in the response message.Class
representing the type of the payload to be contained in the response messageCopyright © 2010–2019. All rights reserved.