100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
Asset addAttribute replaced with addAttributes
Rich Turner469fb43657b6
diff --git a/model/src/main/java/org/openremote/model/asset/Asset.java b/model/src/main/java/org/openremote/model/asset/Asset.javaindex 81eeca1e5..770ab3f54 100644--- a/model/src/main/java/org/openremote/model/asset/Asset.java+++ b/model/src/main/java/org/openremote/model/asset/Asset.java@@ -339,12 +339,16 @@ public class Asset implements IdentifiableEntity {}- public void addAttribute(AssetAttribute attribute) throws IllegalArgumentException {- if (getAttributesStream().anyMatch(attr -> isAttributeNameEqualTo(attr, attribute.getName().orElse(null)))) {- throw new IllegalArgumentException("Attribute by this name already exists");- }-- replaceAttribute(attribute);+ public void addAttributes(AssetAttribute... attributes) throws IllegalArgumentException {+ Arrays.asList(attributes).forEach(+ attribute -> {+ if (getAttributesStream().anyMatch(attr -> isAttributeNameEqualTo(attr, attribute.getName().orElse(null)))) {+ throw new IllegalArgumentException("Attribute by this name already exists");+ }++ replaceAttribute(attribute);+ }+ );}public void replaceAttribute(AssetAttribute attribute) throws IllegalArgumentException {