I have a class with my getters and setters, containing values, for example:
String value1;
String value2;
double result;
I want to use these two strings to determine what should happen with the result. If value1 equals "one" and value2 = "two" then the result should be multiplied by a predefined value.
@GET
@Path("/{value1}/{value2}/{result}")
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public double getResult() {
Something mon = new Something();
mon.setOne(22.2);
mon.setTwo(11.1);
if("/{value1}".equals("one")){
//multiply by mon.setOne;
}
return 0;
}
How do I read and access the values defined in the path?