Example usage for org.apache.commons.collections4 MapUtils getDouble

List of usage examples for org.apache.commons.collections4 MapUtils getDouble

Introduction

In this page you can find the example usage for org.apache.commons.collections4 MapUtils getDouble.

Prototype

public static <K> Double getDouble(final Map<? super K, ?> map, final K key) 

Source Link

Document

Gets a Double from a Map in a null-safe manner.

Usage

From source file:org.rippleosi.patient.heightandweight.search.HeightAndWeightDetailsTransformer.java

@Override
public HeightAndWeightDetails transform(final Map<String, Object> input) {

    final String uid = MapUtils.getString(input, "uid");
    final Double height = MapUtils.getDouble(input, "height");
    final Double weight = MapUtils.getDouble(input, "weight");
    final String heightRecorded = MapUtils.getString(input, "height_recorded");
    final String weightRecorded = MapUtils.getString(input, "weight_recorded");

    final HeightAndWeightDetails heightAndWeight = new HeightAndWeightDetails();

    heightAndWeight.setSource("openehr");
    heightAndWeight.setSourceId(uid);/*  www.jav a2s. c o m*/

    heightAndWeight.setHeight(height);
    heightAndWeight.setWeight(weight);

    heightAndWeight.setHeightRecorded(DateFormatter.toDate(heightRecorded));
    heightAndWeight.setWeightRecorded(DateFormatter.toDate(weightRecorded));

    return heightAndWeight;
}