You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/11/04 23:48:42 UTC

[GitHub] [camel-karavan] mrinalsharma commented on issue #514: Generate Processor code template from Processor step in UI

mrinalsharma commented on issue #514:
URL: https://github.com/apache/camel-karavan/issues/514#issuecomment-1304343409

   I think adding a converter template code from "Convert Body To" will also be useful. How do you plan to do it?
   ```
   
   import java.util.Arrays;
   import java.io.InputStream;
   import java.util.LinkedList;
   import java.io.ByteArrayInputStream;
   
   @Converter
   public class Exampleconverter {
        @Converter
       public static InputStream toInputStream(LinkedList elements) {
   		String [] stringArray = new String[elements.size()];
   		     for(int i =0; i < elements.size(); i++) {
   				stringArray[i] = (String) elements.get(i);
   			 }
           return new ByteArrayInputStream(Arrays.toString(stringArray).getBytes());
       }
   
   }
   ```


-- 
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-unsubscribe@camel.apache.org

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