@@ -0,0 +1,1904 @@
+/*%0A * Copyright 2017 Open mHealth%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.openmhealth.shim.googlefit.mapper;%0A%0Aimport com.fasterxml.jackson.databind.JsonNode;%0Aimport org.openmhealth.schema.domain.omh.DataPoint;%0Aimport org.openmhealth.schema.domain.omh.Speed;%0A%0Aimport java.util.Optional;%0A%0Aimport static org.openmhealth.schema.domain.omh.SpeedUnit.METERS_PER_SECOND;%0Aimport static org.openmhealth.shim.common.mapper.JsonNodeMappingSupport.*;%0A%0A%0A/**%0A * A mapper from Google Fit %22merged speed%22 endpoint responses (derived:com.google.speed:com.google.android.gms:merge_speed)%0A * to %7B@link Speed%7D objects.%0A *%0A * @author Emerson Farrugia%0A * @see %3Ca href=%22https://developers.google.com/fit/rest/v1/data-types%22%3EGoogle Fit Data Type Documentation%3C/a%3E%0A */%0Apublic class GoogleFitSpeedDataPointMapper extends GoogleFitDataPointMapper%3CSpeed%3E %7B%0A%0A    @Override%0A    protected Optional%3CDataPoint%3CSpeed%3E%3E asDataPoint(JsonNode listNode) %7B%0A%0A        JsonNode listValueNode = asRequiredNode(listNode, %22value%22);%0A        double speedValue = asRequiredDouble(listValueNode.get(0), %22fpVal%22);%0A%0A        Speed speed = new Speed.Builder(METERS_PER_SECOND.newUnitValue(speedValue), getTimeFrame(listNode)).build();%0A%0A        Optional%3CString%3E originDataSourceId = asOptionalString(listNode, %22originDataSourceId%22);%0A%0A        return Optional.of(newDataPoint(speed, originDataSourceId.orElse(null)));%0A    %7D%0A%7D%0A

Add Google Fit speed mapper