Triple的使用

Posted charkey

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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;

  

以上是关于Triple的使用的主要内容,如果未能解决你的问题,请参考以下文章