I'm using List.class
because List<String>.class
is wrong. Is there a syntax that gets the class of the parametrized class?
Code:
import java.util.List;
import org.apache.camel.Message;
...
Message m = exchange.getIn();
List<String> serviceIds = null;
serviceIds = m.getHeader("serviceId", List.class);
Of course I would rather have:
serviceIds = m.getHeader("serviceId", List<String>.class);
to ensure that getHeader would return null if a list of something not strings was in the header.