public InnerAccount{
public string isActive;
public Account account;
public InnerAccountacc(Account acc){
this.add_fields = '';
this.account = acc;
}
}
假设现在需要在一个object上增加一个临时的字段,但是不能再object上增加。所以现在只能在类的内部写一个内部类。以Account为例
在取出的object 的时候 可以
Account account_obj = null;
innerAccount_list = new list<innerAccount>();//避免出现nullpointer异常
for(Account acc : account_temp_list ){
account_obj = new Account();
account_obj = acc;
//此处用于修改个别属性
iaccount = new InnerAccount(account_obj);
iaccount.isActive='false';
this.innerAccountz_list .add(iaccount);
}