How to check whether a specific argument is present in the argument list..?

Discussion created by AjayFrancis62132720 on Mar 10, 2015

In one of my scenarios, I came accross with a situation, where I need to look for a specific argument; say "CountryCode", if it is present, I need to create the responses with the values of the argument.

I did something like this



import com.itko.lisa.vse.stateful.model.Request;

import com.itko.util.ParameterList;

Request req = (Request) testExec.getStateValue("lisa.vse.request");

String opName = req.getOperation();

ParameterList args = req.getArguments();

String country= args.get("CountryCode");

IF country is USA THEN




However, It is possible that the incoming request is doesnot contain that specific tag, In that scenario, the above code snippet may throw an exception. Please let me know how can I handle this exception and check whether "args" has my specific tag without an exeception..?