Skip to content

Commit

Permalink
use generics
Browse files Browse the repository at this point in the history
  • Loading branch information
Vivchar Vitaly committed Mar 14, 2017
1 parent 9ab5486 commit eab5d0d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@ int getItemViewType(final int position) {
return item.getType();
}

@SuppressWarnings("unchecked")
@NonNull
private
ItemModel
public
<T extends ItemModel> T
getItem(final int position) {
return mItems.get(position);
return (T) mItems.get(position);
}

@Override
Expand All @@ -79,7 +80,7 @@ int getItemCount() {
}

public
void setItems(@NonNull final List<ItemModel> items) {
void setItems(@NonNull final List<? extends ItemModel> items) {
mItems.clear();
mItems.addAll(items);
}
Expand Down

0 comments on commit eab5d0d

Please sign in to comment.