Should I extend ArrayList to add attributes that isn't null?

前端 未结 4 797
孤街浪徒
孤街浪徒 2020-12-30 09:45

I would like to add a collection of objects to an arrayList ,only if the particular attribute is not null.

I am thinking of extending the ArrayList and implementing

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-30 10:36

    Only issue would be if you go to reuse this code and you don't remember you've overriden the ArrayList class, make sure to comment thoroughly.

提交回复
热议问题