I have a following line of code:
silk.<DomButton>find(buttonSubmitSearchXPathMain).select();
I’ve never seen a method being accompanied by <xxx>. I have a few other methods like that with the same brackets but different words. Unfortunately I’m unable to read the source for this method. Can someone please explain what is it? Just a description of a method? What is a purpose of it? Where can I read about it?
It’s a call to a static generic method. Have a look at this article.
Generics allow generic programming.
For example this is a generic class:
where generic type T is determined at compile time while instantiating the class.
You can force the generic type to be descendant of a particular type. Example:
This is useful to allow generic programming because inside a method you can threat the generic type independently of which is its real type.For example:
In your case you are specifying the generic type while calling the static method, because of its static nature it could be invoked without having an instance.