public class AnnotatedHandlerAttributes extends Object implements HandlerAttributes
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.
AGGREGATE_CREATION_POLICY, ALLOW_REPLAY, COMMAND_NAME, COMMAND_ROUTING_KEY, 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, SHUTDOWN_PHASE, START_PHASE| Constructor and Description |
|---|
AnnotatedHandlerAttributes(AnnotatedElement annotatedElement)
Create an
AnnotatedHandlerAttributes containing all attributes of annotations (meta-)annotated with
HasHandlerAttributes on the given annotatedElement. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(String attributeKey)
Validates whether the given
attributeKey is present in this object. |
boolean |
equals(Object o) |
<R> R |
get(String attributeKey)
Retrieve the attribute for the given
attributeKey. |
Map<String,Object> |
getAll()
Retrieve all attributes stored in this
HandlerAttributes object. |
int |
hashCode() |
boolean |
isEmpty()
Validate whether zero attributes are present in this object.
|
HandlerAttributes |
mergedWith(HandlerAttributes other)
|
String |
toString() |
public AnnotatedHandlerAttributes(AnnotatedElement annotatedElement)
AnnotatedHandlerAttributes containing all attributes of annotations (meta-)annotated with
HasHandlerAttributes on the given annotatedElement. Each attribute will be stored based on the
simple name of the annotation (meta-)annotated with HasHandlerAttributes combined with the attribute
name.
The handler annotation name and attribute name are separated by dots. This leads to a key format of "[handlerType].[attributeName]".
annotatedElement - the AnnotatedElement to extract handler attributes forpublic <R> R get(String attributeKey)
HandlerAttributesattributeKey. Might be null if there is no attribute present
for the given key.get in interface HandlerAttributesR - the type of attribute to retrieveattributeKey - the attribute key to retrieve an attribute forattributeKeypublic Map<String,Object> getAll()
HandlerAttributesHandlerAttributes object.getAll in interface HandlerAttributesHandlerAttributes objectpublic boolean contains(String attributeKey)
HandlerAttributesattributeKey is present in this object.contains in interface HandlerAttributesattributeKey - the attribute key to validate if it is present in this objecttrue if there is an attribute for the given attributeKey present, false otherwisepublic boolean isEmpty()
HandlerAttributesisEmpty in interface HandlerAttributestrue if there are no attributes present, false otherwisepublic HandlerAttributes mergedWith(HandlerAttributes other)
HandlerAttributesHandlerAttributes, merging the attributes in this instance with the given attributes. If this and other have identical entries, the values from other will take
precedence.mergedWith in interface HandlerAttributesother - the HandlerAttributes to group with this instance's attributesHandlerAttributes combining this instance's attributes and the given other
attributesCopyright © 2010–2023. All rights reserved.