From 581917608d6d057881220710e235d192caee90bb Mon Sep 17 00:00:00 2001 From: Sascha Doemer Date: Sun, 3 Mar 2024 10:54:31 +0100 Subject: [PATCH] Feature/use generic attribute to allow empty values (#50) * Refactor DeviceMeasurement model attributes Simplified variable types in the DeviceMeasurement model. Instead of having separate attribute types, all attributes are generalized under 'Attribute'. This makes the code cleaner and more maintainable, removing the need for specific attribute types. * Update version in pom.xml Increased the version of the FIWARE integration layer project in pom.xml from 12.0.0 to 12.1.0. This version bump corresponds to the --- pom.xml | 2 +- .../app/fivegla/fiware/model/DeviceMeasurement.java | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 72c1e21..b0a0056 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ de.app.5gla fiware-integration-layer - 12.0.0 + 12.1.0 5gLa FIWARE integration layer https://github.com/vitrum-connect/5gla-fiware-integration-layer diff --git a/src/main/java/de/app/fivegla/fiware/model/DeviceMeasurement.java b/src/main/java/de/app/fivegla/fiware/model/DeviceMeasurement.java index 54f7248..704c8f5 100644 --- a/src/main/java/de/app/fivegla/fiware/model/DeviceMeasurement.java +++ b/src/main/java/de/app/fivegla/fiware/model/DeviceMeasurement.java @@ -2,9 +2,7 @@ import de.app.fivegla.fiware.api.FiwareType; import de.app.fivegla.fiware.model.api.Validatable; -import de.app.fivegla.fiware.model.internal.DateTimeAttribute; -import de.app.fivegla.fiware.model.internal.NumberAttribute; -import de.app.fivegla.fiware.model.internal.TextAttribute; +import de.app.fivegla.fiware.model.internal.Attribute; import org.apache.commons.lang3.StringUtils; /** @@ -15,10 +13,10 @@ public record DeviceMeasurement( String id, String type, - TextAttribute name, - NumberAttribute controlledProperty, - DateTimeAttribute dateCreated, - TextAttribute externalDataReference, + Attribute name, + Attribute controlledProperty, + Attribute dateCreated, + Attribute externalDataReference, double latitude, double longitude ) implements Validatable {