This repository has been archived by the owner on Apr 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/adapt location to create valid entries (#40)
* Replace Attribute type with new Location type for device measurements The "location" in DeviceMeasurements has been updated from the generic Attribute type to use a new explicit Location class. Correspondingly, the DeviceMeasurementBuilder has been adjusted to work with the Location class when setting the location. The format for geographical information in FiwareTypes was updated from "geo:point" to "geo:json" to align with this change. * Update version in pom.xml The version of the "fiware-integration-layer" artifact in pom.xml has been updated from 10.2.0 to 10.3.0. This is a routine version bump as part of our product lifecycle management.
- Loading branch information
1 parent
0dc0b0d
commit bfda5a9
Showing
5 changed files
with
52 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/main/java/de/app/fivegla/fiware/model/generic/Location.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package de.app.fivegla.fiware.model.generic; | ||
|
||
import de.app.fivegla.fiware.api.FiwareTypes; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
/** | ||
* The Attribute class represents an attribute with a name, type, and value. | ||
*/ | ||
@Getter | ||
@Setter | ||
public class Location { | ||
|
||
/** | ||
* The value of an Attribute. | ||
* <p> | ||
* This variable represents the value of an attribute. It is a private instance variable | ||
* in the Attribute class. The value is stored as a String. | ||
*/ | ||
private String value; | ||
|
||
/** | ||
* The latitude of a location. | ||
* <p> | ||
* This variable represents the latitude of a location. It is a private instance variable | ||
* in the Location class which is a part of the Attribute class. The latitude is stored as a double. | ||
* The latitude is used along with the longitude to represent a geographical point in the Fiware platform. | ||
*/ | ||
private double latitude; | ||
|
||
/** | ||
* The longitude of a location. | ||
* <p> | ||
* This variable represents the longitude of a location. It is a private instance variable | ||
* in the Location class which is a part of the Attribute class. The longitude is stored as a double. | ||
* The longitude is used along with the latitude to represent a geographical point in the Fiware platform. | ||
*/ | ||
private double longitude; | ||
|
||
public String asJson() { | ||
return "{\"type\":\"" + FiwareTypes.GEO_POINT.getKey() + "\",\"value\":{\"type\":\"Point\",\"coordinates\":[" + longitude + "," + latitude + "]}}"; | ||
} | ||
|
||
} |