I am new to Java. I need a custom type in java that I can use to validate a field from a web api.
Eg: I receive a string field in xml payload format like ff-ppp-ll – ff-pp-ll with a pair of strings ‘-‘ in between, each string is made up of some strings, ‘-‘ between them as shown above. I want to validate this field against the custom type I want to implement. Please advise me on this, suggest any other good technique which will make my work easier.
I need to make sure of two things here, 1. The format of the string and 2. Each individual part of the string (after excluding ‘-‘) should be validated against the master data, usually cached from the database when the application services start.
sample: 75B-BSHS-21 – 75B-ROSN-21
Thanks
I should be able parse the field against the custom type.