OfficeDev / Office-365-SDK-for-Android

Microsoft Services SDKs for Android produced by MS Open Tech.
https://dev.office.com/android
Other
224 stars 74 forks source link

Generics methods should scope the template parameters types as much as possible #21

Closed lt72 closed 10 years ago

lt72 commented 10 years ago

ODataCollectionFetcher<T, U, V> and ODataEntityFetcher<E, V> should carry more information about the type of the parameters using the 'extend' keywork.

e.g.: this actually compiles: ODataCollectionFetcher<T extends Entity, U extends ODataEntityFetcher, V extends ODataOperations>

and

ODataEntityFetcher<E extends Entity, V extends ODataOperations>

marcote commented 10 years ago

@lt72 This completely makes senses but with a small exception: We don't have a base Entity class to inherit from in every SDKs. Discovery API does not have a base class, hence there is no constraint available. In order to make the change as generic as posible to the T4 templates, this is what I can do:

ODataCollectionFetcher<T, U extends ODataEntityFetcher, V extends ODataOperations>

ODataEntityFetcher<E, V extends ODataOperations>

I will proceed with this change.

marcote commented 10 years ago

Fix applied in 3d451733b750322e82c435a72c4e572e68e16041