Skip to content

Commit

Permalink
Fix metric valueType on JsonKapuaPayload
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Mezzasalma <claudio.mezzasalma@eurotech.com>
  • Loading branch information
Claudio Mezzasalma authored and Coduz committed Oct 21, 2019
1 parent 9177c1d commit 055e282
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.kapua.app.api.resources.v1.resources.model.data;

import org.eclipse.kapua.message.device.data.KapuaDataChannel;
import org.eclipse.kapua.service.datastore.model.DatastoreMessage;
import org.eclipse.kapua.service.datastore.model.Storable;
import org.eclipse.kapua.service.datastore.model.StorableId;
Expand Down Expand Up @@ -52,7 +51,7 @@ public JsonDatastoreMessage(DatastoreMessage datastoreMessage) {
setCapturedOn(datastoreMessage.getCapturedOn());

setPosition(datastoreMessage.getPosition());
setChannel((KapuaDataChannel) datastoreMessage.getChannel());
setChannel(datastoreMessage.getChannel());
setPayload(datastoreMessage.getPayload());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public JsonKapuaPayload(KapuaPayload payload) {
XmlAdaptedMetric jsonMetric = new XmlAdaptedMetric();

jsonMetric.setName(metricName);
jsonMetric.setValueType(metricName.getClass());
jsonMetric.setValueType(metricValue.getClass());
jsonMetric.setValue(ObjectValueConverter.toString(metricValue));

getMetrics().add(jsonMetric);
Expand Down

0 comments on commit 055e282

Please sign in to comment.