我有一个班级:
@JsonIgnoreProperties(ignoreUnknown = true)
class Match {
List<InningDetail> innings;
}
我想像这样对innings
进行排序:
Collections.sort(innings, new Comparator<InningDetail>() {
@Override
public int compare(InningDetail lhs, InningDetail rhs) {
return lhs.getInningsNo() > rhs.getInningsNo() ? 0 : 1;
}
});
如何在反序列化后执行排序?