I have the following usecase and looking for the right solution.
We are reading a csv file and populating a POJO.One column in from the file could map to multiple fields in the POJO.
eg:
Class Test {
private String field1;
private String field2;
private String field3;
......
other fields
---
getter methods
.....
setter methods
}
Let us say value of column XXXX from file is 123_TEST_34_THJ
the field1 value is 123 field2 value is 34 filed3 value THJ
I can do this in the Java code, but I am looking a solution to split this dynamically. Let us say the value of XXXX is now changed to 124_34_THJ, I want my code to work just with a configuration change. What would be a better solution? Please let me know if the question is not clear.