Collections.sort(list, new Comparator<ProductTypeField>() {
@Override
public int compare(ProductTypeField o1, ProductTypeField o2) {
Integer sort1 = o1.getSort();
Integer sort2 = o2.getSort();
return sort1.compareTo(sort2);
}
});
Collections.sort(returnList, new Comparator<Map<String, Object>>() {
@Override
public int compare(Map<String, Object> o1, Map<String, Object> o2) {
BigDecimal endPrice1 = new BigDecimal(o1.get("endPrice").toString());
BigDecimal endPrice2 = new BigDecimal(o2.get("endPrice").toString());
return endPrice1.compareTo(endPrice2);
}
});
Collections.sort(returnList, (o1,o2) -> {
BigDecimal endPrice1 = new BigDecimal(o1.get("endPrice").toString());
BigDecimal endPrice2 = new BigDecimal(o2.get("endPrice").toString());
return endPrice1.compareTo(endPrice2)
});