1.方法

Collections.reverse(list);

2.代码示例

/**
* 从redis中将现场状态的记录全部取出
* @param aucId
* @return
*/
@RequestMapping(value = "/findAllAuctionLocalStatementRecord", method = RequestMethod.POST)
@ResponseBody
public List<Object> findAllAuctionLocalStatementRecord(String aucId) {
if (logger.isDebugEnabled()) {
logger.debug("findAllAuctionLocalStatementRecord, aucId:{}", aucId);
} List<Object> list = redisTemplateListDTO.opsForValue().get("auctionLocalStatement"+aucId);
Collections.reverse(list);//将list集合倒序排列取出,时间最新的在最上面 return list;
}
05-07 15:26