Triple的使用

public Triple<Long, Long, Double> getCarRunSummary(String did, Date startDate, Date endDate) {
    Map<String, Object> map = kuduRepository.getCarRunSummary(did, startDate, endDate);
if (map != null) {
    Long mileage = map.get("total_mileage") != null ? ((Number) map.get("total_mileage")).longValue() : null;
    Long runTime = map.get("total_run_time") != null ? ((Number) map.get("total_run_time")).longValue() : null;
    Double fuelConsumption = map.get("total_fuel_consumption") != null ? ((Number) map.get("total_fuel_consumption")).doubleValue() : null;
    return Triple.of(mileage, runTime, fuelConsumption);
}
    return null;
}

  

posted @ 2019-06-03 13:52  蔡徐坤1987  阅读(302)  评论(0编辑  收藏  举报