orpiske commented on code in PR #9968:
URL: https://github.com/apache/camel/pull/9968#discussion_r1181021055


##########
core/camel-support/src/main/java/org/apache/camel/support/MessageSupport.java:
##########
@@ -306,4 +310,20 @@ protected String createMessageId() {
         }
     }
 
+    @Override
+    public boolean hasTrait(MessageTrait trait) {
+        Object payload = traits[trait.ordinal()];
+
+        return payload != null;
+    }
+
+    @Override
+    public Object getPayloadForTrait(MessageTrait trait) {
+        return traits[trait.ordinal()];
+    }
+
+    @Override
+    public void setPayloadForTrait(MessageTrait trait, Object object) {
+        traits[trait.ordinal()] = object;
+    }

Review Comment:
   This part here: if accepted, then I'll do create a separate class to 
abstract this. We already do a similar thing when handling the 
`internalProperties` on the 
[AbstractExchange](https://github.com/apache/camel/blob/main/core/camel-support/src/main/java/org/apache/camel/support/AbstractExchange.java#L252-L276).
 So, there's room for future cleanup and consolidation of the code base.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to