Hi all,
I have a strange requirement.
I have a String like:
Meals(veg(soup&starters(price=40 || 50))nonveg(seaFood)delivery=parcel || ready_to_eat)
I parse this string and put all the values with in veg to a string array
example:
String[] veg = {soup,starters}
String[] nonveg = {seafood}
String[] delivery={parcel,ready_to_eat}
Now, my question is:
I need to validate these values.
Example:
Meals = it should be validated against uppercase or lowercase, and correct spelling. if it fails, no need to validate other stuff.
If Meals is validated succssfully, I need to validate veg in such a way that:
veg should have only soup and starters with in that. nothing else.
if it has
veg(salad) then, the validation should fails and send "fail" as response.
Is there a best design to do this ? My desing as follows:
My problem is how to call the methods or the sequence of methods? so that the complete Order String is validated.
do i need to put the method calls in if...else or in switch statement or is there any other way? I want the best desing for this issue.
Please help me?