Description
It would be nice to have a builder like pattern to add values to MapMessage and its subclass StructuredDataMessage, so you can do
EventLogger.logEvent( new StructuredDataMessage(confirm, null, "transfer") .withValue("toAccount", toAccount) .withValue("fromAccount", fromAccount) .withValue("amount", amount) );
instead of
StructuredDataMessage msg = new StructuredDataMessage(confirm, null, "transfer"); msg.put("toAccount", toAccount); msg.put("fromAccount", fromAccount); msg.put("amount", amount); EventLogger.logEvent(msg);