-
Notifications
You must be signed in to change notification settings - Fork 654
Open
Description
@Override
public void swap(int fromPos, int toPos, List<NewsTypeInfo> list) {
NewsTypeInfo fromInfo = list.get(fromPos);
NewsTypeInfo toInfo = list.get(toPos);
NewsTypeInfo tem = fromInfo;
//要重写创建对象,不能去改变源对象,因为源对象在多处使用到
fromInfo = new NewsTypeInfo(tem.getId(), toInfo.getName(), toInfo.getTypeId());
toInfo = new NewsTypeInfo(toInfo.getId(), tem.getName(), tem.getTypeId());
update(fromInfo);
update(toInfo);
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels