Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
stephbzr
Contributor III
Contributor III

Alternatives to creating multiple case blocks

Hello,

I'm currently working on extracting data from a file using a tJavaFlex. I use the substring method a lot. But now I need to use cases. In fact, I'm extracting a string from the file that can correspond to more than 100 categories. I can create a hundred cases in my tJavaFlex, but that makes the code harder to read. So is there a more efficient way to do this in Talend?

Thank you !

Labels (4)
1 Reply
Anonymous
Not applicable

Hello @Stéphane Barbezier​ ,

To avoid multiple switch case statements in java, you can use HashMap as instead.

Please refer to this:

https://stackoverflow.com/questions/64692014/how-to-avoid-multiple-switch-case-statements

 

Best regards

Aiming