类似的东西:
Ordering<Iterable<ImportXmlRecord>> comparator =
Ordering.natural().lexicographical().onResultOf();
但按ImportXmlRecord字段排序?
答案 0 :(得分:3)
不完全:
Ordering<Iterable<ImportXmlRecord>> comparator = Ordering.natural()
.onResultOf(new Function<ImportXmlRecord, Whatever>() {
public Whatever apply(ImportXmlRecord x) { return x.getWhatever(); }
}.lexicographical();