From 14f492011315aa1173a44eaa839f939c151f94cf Mon Sep 17 00:00:00 2001 From: Riegel Date: Wed, 13 Nov 2024 11:25:34 +0100 Subject: [PATCH] Improve value-String creation of GenericAttribute --- .../citydoctor2/datastructure/GenericAttribute.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/GenericAttribute.java b/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/GenericAttribute.java index 62621232..041c688b 100644 --- a/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/GenericAttribute.java +++ b/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/GenericAttribute.java @@ -26,7 +26,7 @@ public class GenericAttribute { if (attributeProperty.getObject() instanceof StringAttribute sa) { type = "StringAttribute"; - value = sa.getValue(); + value = String.format("\"%s\"", sa.getValue()); } else if (attributeProperty.getObject() instanceof IntAttribute ia) { type = "IntAttribute"; value = ia.getValue().toString(); @@ -41,10 +41,10 @@ public class GenericAttribute { value = ua.getValue(); } else if (attributeProperty.getObject() instanceof MeasureAttribute ma) { type = "MeasureAttribute"; - value = ma.getValue().toString(); + value = String.format("%s %s", ma.getValue().getValue().toString(), ma.getValue().getUom()); } else if (attributeProperty.getObject() instanceof CodeAttribute ca) { - type = "CodeAttribute"; - value = ca.getValue().toString(); + type = String.format("CodeAttribute (%s)", ca.getValue().getLanguage()); + value = String.format("'''%s''' %n CodeSpace: %s", ca.getValue().getValue(), ca.getValue().getCodeSpace()); } else { logger.warn("GenericAttribute {} is of unknown type {}", attributeProperty, attributeProperty.getObject()); value = attributeProperty.getObject().getValue().toString(); -- GitLab