What are advantages by introducing Generics to new Java client 3.0.0?

Hi All,

As per new java client 3.0.0, the new concept introduce generics (however, I know generics in java) which has additional dependencies on selenium standalone server 2.46 but i have curiosity to know how it can be helpful?
@SergeyTichomirov and @jonahss , can you post basic example (for android or ios) how it is helpful, is new changes affects pagefactory framework which already uses @find annotation in scripts?

Thanks,
Priyank Shah

The specific advantage is that before, appium drivers would only return WebElement objects, and you had to cast to MobileElement or IOSElement. Now, when you instantiate a driver with the generic, it can return that type of element.

before:
MobileElement el = (MobileElement) driver.findElementByName('name');

after:
MobileElement el = driver.findElementByName('name');

The same is true for lists

This expression causes compilation error
List**<MobileElement>** el = (List**<MobileElement>**) driver.findElementByName(‘name’);

with 3.0.0 it works
List**<MobileElement>** el = List**<MobileElement>** driver.findElementByName(‘name’);

It is expected that it doesn’t affect page objects