比如数据是这样的
class AModel{
BModel b;
}
class BModel{
CModel c;
}
class CModel{
getName();
}
然后传入Adapter的model是A,所以 取得数据时调用为:a.getB().getC().getName();
但是这中间很可能出现为null的情况,所以我的做法是,if(a != null && a.getB() != null && a.getB().getC() != null && !TextUtils.isEmpty(a.getB().getC().getName())),有更好的办法吗??