use of org.wso2.iot.sampledevice.api.dto.SensorRecord in project product-iots by wso2.
the class APIUtil method createSensorData.
/**
* @param record Record to convert to SensorRecord
* @return SensorRecord
*/
public static SensorRecord createSensorData(Record record) {
SensorRecord recordBean = new SensorRecord();
recordBean.setId(record.getId());
recordBean.setValues(record.getValues());
return recordBean;
}
use of org.wso2.iot.sampledevice.api.dto.SensorRecord in project product-iots by wso2.
the class APIUtil method createSensorData.
/**
* Creates the SensorDatas from records.
*
* @param records the records
* @return the Map of SensorRecord <id, SensorRecord>
*/
public static Map<String, SensorRecord> createSensorData(List<Record> records) {
Map<String, SensorRecord> sensorDatas = new HashMap<>();
for (Record record : records) {
SensorRecord sensorData = createSensorData(record);
sensorDatas.put(sensorData.getId(), sensorData);
}
return sensorDatas;
}
Aggregations