May be we can
avoid the enum type by using generics?
<T extends EntityReference> T getCurrentEntityReference();
Not sure if this is a good practice though.
Generic does not exist in the bytecode so impossible to know that you
want the EntityType.WIKI if you don't explicitly ask for it.
Right. Inside the method we'd have no clue what the client code is
requesting.
Would be cool if we can somehow not depend on the EntityReference
implementation type within the getCurrentEntityReference() method (thereby
not having to know which type the user wants but just cast and return what
is available). But I don't know if this is possible, and this would still
mean having to do an unsafe cast like:
EntityReference ref = ....;
return (T) ref;
which is also not that good.
Thanks.
- Asiri
- Asiri
WDYT?
Thanks
-Vincent
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
Thomas Mortagne
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs