Package com.mayam.wf.mq
Class AttributeMessageBuilder
java.lang.Object
com.mayam.wf.mq.AttributeMessageBuilder
A builder for
AttributeMap
based MqMessage
objects.
@Inject Provider<AttributeMessageBuilder> builderProvider; ... MqMessage message = builderProvider.get() .subject(task) .highlight(AttributeSet.of(Attribute.TASK_STATE, Attribute.ASSET_SITE_ID)) .build();
- Author:
- Markus Mårtensson
-
Constructor Summary
ConstructorDescriptionAttributeMessageBuilder
(javax.inject.Provider<MqMessage> msgProvider, javax.inject.Provider<AttributeMap> mapProvider, com.mayam.wf.attributes.server.AttributeMapMapper mapper) -
Method Summary
Modifier and TypeMethodDescriptionbefore
(AttributeMap before) Specifies the "before" of a before/after subject pair for aContentTypes.ATTRIBUTE_PAIRS
message.build()
Builds anMqMessage
based on the information collected.Specifies a set of attributes that should be excluded from serialization.Specifies a set of attributes that should be highlighted as a property of theMqMessage
.static String
highlightedPropertyName
(boolean isBefore, Attribute attribute) Returns the property name used for a highlighted attribute.Specifies a set of attributes that should be included in serialization.subject
(AttributeMap subject) Specifies the subjectAttributeMap
described in theContentTypes.ATTRIBUTES
message, or the "after" of a before/after subject pair for aContentTypes.ATTRIBUTE_PAIRS
message.
-
Constructor Details
-
AttributeMessageBuilder
@Inject public AttributeMessageBuilder(javax.inject.Provider<MqMessage> msgProvider, javax.inject.Provider<AttributeMap> mapProvider, com.mayam.wf.attributes.server.AttributeMapMapper mapper)
-
-
Method Details
-
include
Specifies a set of attributes that should be included in serialization.- Parameters:
includeSet
- the set of attributes to include.- Returns:
- the builder for chaining purposes.
-
exclude
Specifies a set of attributes that should be excluded from serialization.- Parameters:
excludeSet
- the set of attributes to exclude.- Returns:
- the builder for chaining purposes.
-
highlight
Specifies a set of attributes that should be highlighted as a property of theMqMessage
.- Parameters:
highlightSet
- the set of attributes to highlight.- Returns:
- the builder for chaining purposes.
-
build
Builds anMqMessage
based on the information collected.