In Java 8+ I can replace

                        process(new Processor() {
                                public void process(Exchange exchange) {
                                        String uuid = 
UUID.randomUUID().toString();
                                        
exchange.getIn().setHeader("CareManagementID", uuid);
                                }
                        }).

with

                        process((exchange) -> {
                                String uuid = UUID.randomUUID().toString();
                                exchange.getIn().setHeader("CareManagementID", 
uuid);
                                }).

using a Java Lambda expression. This is because the Processor Interface
adherers to Java 8+ definition of a Functional Interface (minus the optional
Annotation).

Does anyone have objections to this approach or believe that the Processor
Interface would ever change in the future?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Processor-Interface-and-Java-Lambda-Expression-tp5771449.html
Sent from the Camel Development mailing list archive at Nabble.com.

Reply via email to