Class AnnotatedHandlerAttributes
java.lang.Object
org.axonframework.messaging.core.annotation.AnnotatedHandlerAttributes
- All Implemented Interfaces:
HandlerAttributes
Container for message handler attributes, constructed through inspecting an
AnnotatedElement. It does so by
validating all (meta-)annotations of the given element for the presence of the HasHandlerAttributes
annotation. Each found (meta-)annotation's attributes will be included.
This implementation can discover several collections of attributes. All attributes are prefixed with the simple name
of the annotation (meta-)annotated with HasHandlerAttributes, separated by a dot.
- Since:
- 4.5.0
- Author:
- Steven van Beelen
-
Field Summary
Fields inherited from interface org.axonframework.messaging.core.annotation.HandlerAttributes
AGGREGATE_CREATION_POLICY, ALLOW_REPLAY, COMMAND_NAME, COMMAND_NAME_PATTERN, COMMAND_ROUTING_KEY, DEADLINE_NAME, EVENT_NAME, EXCEPTION_RESULT_TYPE, FORCE_NEW_SAGA, MESSAGE_TYPE, PAYLOAD_TYPE, QUERY_NAME, RESULT_TYPE, SAGA_ASSOCIATION_PROPERTY, SAGA_ASSOCIATION_PROPERTY_KEY_NAME, SAGA_ASSOCIATION_RESOLVER -
Constructor Summary
ConstructorsConstructorDescriptionAnnotatedHandlerAttributes(AnnotatedElement annotatedElement) Create anAnnotatedHandlerAttributescontaining all attributes of annotation (meta-)annotated withHasHandlerAttributeson the givenannotatedElement. -
Method Summary
Modifier and TypeMethodDescriptionbooleanValidates whether the givenattributeKeyis present in this object.boolean<R> RRetrieve the attribute for the givenattributeKey.getAll()Retrieve all attributes stored in thisHandlerAttributesobject.inthashCode()booleanisEmpty()Validate whether zero attributes are present in this object.mergedWith(HandlerAttributes other) Returns aHandlerAttributes, merging the attributes inthisinstance with the givenattributes.toString()
-
Constructor Details
-
AnnotatedHandlerAttributes
Create anAnnotatedHandlerAttributescontaining all attributes of annotation (meta-)annotated withHasHandlerAttributeson the givenannotatedElement. Each attribute will be stored based on the simple name of the annotation (meta-)annotated withHasHandlerAttributescombined with the attribute name.The handler annotation name and attribute name are separated by dots. This leads to a key format of
"[handlerType].[attributeName]".- Parameters:
annotatedElement- theAnnotatedElementto extract handler attributes for
-
-
Method Details
-
get
Description copied from interface:HandlerAttributesRetrieve the attribute for the givenattributeKey. Might benullif there is no attribute present for the given key.- Specified by:
getin interfaceHandlerAttributes- Type Parameters:
R- the type of attribute to retrieve- Parameters:
attributeKey- the attribute key to retrieve an attribute for- Returns:
- the attribute for the given
attributeKey
-
getAll
Description copied from interface:HandlerAttributesRetrieve all attributes stored in thisHandlerAttributesobject.- Specified by:
getAllin interfaceHandlerAttributes- Returns:
- all attributes stored in this
HandlerAttributesobject
-
contains
Description copied from interface:HandlerAttributesValidates whether the givenattributeKeyis present in this object.- Specified by:
containsin interfaceHandlerAttributes- Parameters:
attributeKey- the attribute key to validate if it is present in this object- Returns:
trueif there is an attribute for the givenattributeKeypresent,falseotherwise
-
isEmpty
public boolean isEmpty()Description copied from interface:HandlerAttributesValidate whether zero attributes are present in this object.- Specified by:
isEmptyin interfaceHandlerAttributes- Returns:
trueif there are no attributes present,falseotherwise
-
mergedWith
Description copied from interface:HandlerAttributesReturns aHandlerAttributes, merging the attributes inthisinstance with the givenattributes. Ifthisandotherhave identical entries, the values fromotherwill take precedence.- Specified by:
mergedWithin interfaceHandlerAttributes- Parameters:
other- TheHandlerAttributesto group withthisinstance's attributes.- Returns:
- A
HandlerAttributescombiningthisinstance's attributes and the givenotherattributes.
-
equals
-
hashCode
public int hashCode() -
toString
-