Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
Add metadata to attribute in DeviceMeasurementBuilder
Browse files Browse the repository at this point in the history
The updated code adds a metadata list to the attribute in the DeviceMeasurementBuilder class. This is achieved by setting the metadata to the attribute of deviceMeasurement. The change enhances the flexibility of the attribute, allowing it to contain more information about the DeviceMeasurement.
  • Loading branch information
saschadoemer committed Feb 27, 2024
1 parent 434f3c0 commit e99ee3d
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import de.app.fivegla.fiware.model.generic.Metadata;

import java.time.Instant;
import java.util.List;

/**
* The DeviceMeasurementBuilder class is responsible for building instances of the DeviceMeasurement class.
Expand Down Expand Up @@ -69,6 +70,7 @@ public DeviceMeasurementBuilder withMeasurement(String name, String type, String
metadata.setName("dateObserved");
metadata.setType(FiwareTypes.DATE_TIME.getKey());
metadata.setValue(dateObserved.toString());
attribute.setMetadata(List.of(metadata));
deviceMeasurement.setMeasurement(attribute);
return this;
}
Expand Down

0 comments on commit e99ee3d

Please sign in to comment.