Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Its correct for single field ie firstName, If we apply this method ie createLogs() for more then one fields (last name, DOB,city, state,zip code) - there should be mapping, So question is how i can write the Generic method to receive the field name,field value ,error code ,message , transaction id ,status ? these arguments may grow or shrink based on validation pass or failure . Please refer the code
Adding key value combination in hashmap and logging will be the same for validation success Or failure. Only key and value will be change... is there any way to write this code in jeneric method to avoid duplication of code?